/* 
* Cleaned CSS for Circle Sign-in Pages
* Only includes styles used in index.html
*/

/* ==================== */
/* Base Styles - Common */
/* ==================== */
:root {
  /* Light mode colors */
  --bg-color: #ffffff;
  --text-primary: #000000;
  --text-secondary: #555555;
  --text-muted: #888888;
  --border-color: #dddddd;
  --input-bg: #ffffff;
  --card-bg: #ffffff;
  --button-bg: #000000;
  --button-text: #ffffff;
  --button-hover: #333333;
  --shadow-color: rgba(0, 0, 0, 0.08);
  --link-color: #555555;
  --focus-color: #000000;
  --divider-color: #eeeeee;
  --alt-button-bg: #f5f5f5;
  --alt-button-hover: #eeeeee;
  --toggle-bg: #f5f5f5;
  --toggle-active: #000000;
}

.dark-mode {
  /* Dark mode colors */
  --bg-color: #000000;
  --text-primary: #ffffff;
  --text-secondary: #aaaaaa;
  --text-muted: #777777;
  --border-color: #333333;
  --input-bg: #000000;
  --card-bg: #000000;
  --button-bg: #ffffff;
  --button-text: #000000;
  --button-hover: #e6e6e6;
  --shadow-color: rgba(0, 0, 0, 0.25);
  --link-color: #aaaaaa;
  --focus-color: #ffffff;
  --divider-color: #333333;
  --alt-button-bg: #2a2a2a;
  --alt-button-hover: #333333;
  --toggle-bg: #333333;
  --toggle-active: #ffffff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Exo 2", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Background - Common */
.background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.background img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
  position: absolute;
  top: 0;
  left: 0;
  transition: opacity 0.3s ease;
}

.bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
}

.light-bg {
  display: block;
}

.dark-bg {
  display: none;
}

.dark-mode .light-bg {
  display: none;
}

.dark-mode .dark-bg {
  display: block;
}

/* Card Container Structure */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 20px;
  box-sizing: border-box;
}

.login-container {
  width: 100%;
  max-width: 1200px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-card {
  width: 100%;
  max-width: 400px;
  text-align: center;
  padding: 28px 24px;
  border-radius: 20px;
  background-color: var(--card-bg);
  box-shadow: 0 10px 30px var(--shadow-color);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeIn 0.5s ease-out forwards;
}

/* Divider Styles */
.divider {
  display: flex;
  align-items: center;
  margin: 16px 0;
  color: var(--text-muted);
}

.divider-line {
  flex: 1;
  height: 1px;
  background-color: var(--divider-color);
  margin: 0;
  transform: translateY(1px);
}

.divider-text {
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
}

/* Typography */
.logo img {
  max-width: 50px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

h1 {
  font-size: 20px;
  color: var(--text-primary);
  margin: 16px 0 8px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.subtitle {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.2px;
}

.subtitle strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Form Elements */
.login-form {
  width: 100%;
}

.input-group {
  position: relative;
  margin-bottom: 6px;
  margin-top: 12px;
  text-align: left;
  transition: all 0.3s ease;
}

.input-group:first-of-type {
  margin-top: 0;
}

.input-icon-wrapper {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.input-icon {
  width: 20px;
  height: 20px;
  opacity: 0.7;
  filter: var(--icon-filter, none);
  transition: opacity 0.3s ease;
}

.dark-mode .input-icon {
  --icon-filter: invert(1);
}

input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 16px 16px 16px 48px;
  background: var(--input-bg);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  font-size: 16px;
  color: var(--text-primary);
  transition: all 0.3s;
  position: relative;
  z-index: 1;
}

input[type="password"] {
  padding-right: 48px;
}

input[type="email"]::placeholder,
input[type="password"]::placeholder {
  color: var(--text-muted);
  transition: color 0.3s ease, transform 0.3s ease;
}

input[type="email"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--focus-color);
}

.password-toggle {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  color: var(--text-secondary);
}

.password-toggle i {
  font-size: 18px;
  transition: color 0.2s;
}

.password-toggle:hover i {
  color: var(--text-primary);
}

.error-message {
  color: #ff3b30;
  font-size: 13px;
  margin-top: 2px;
  margin-bottom: 16px;
  display: none;
  animation: fadeIn 0.3s ease-out;
  text-align: left;
  padding-left: 16px;
  font-weight: 500;
  letter-spacing: -0.2px;
  line-height: 1.2;
  transform: translateY(-2px);
  opacity: 0;
  transition: all 0.3s ease;
}

.error-message.visible {
  display: block !important;
  opacity: 1 !important;
  transform: translateY(0);
  margin: 8px 0;
  min-height: 20px;
}

.input-group.error input {
  border-color: #ff3b30;
  box-shadow: 0 0 0 1px rgba(255, 59, 48, 0.1);
}

.input-group.error .input-icon {
  opacity: 0.9;
  filter: brightness(0.9) sepia(1) saturate(5) hue-rotate(320deg);
}

.dark-mode .input-group.error .input-icon {
  filter: brightness(0.9) sepia(1) saturate(5) hue-rotate(320deg) invert(1);
}

.forgot-password {
  text-align: right;
  margin-top: 8px;
  margin-bottom: 16px;
}

.forgot-password a {
  color: var(--link-color);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s ease;
  position: relative;
}

.forgot-password a::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 1px;
  bottom: -2px;
  left: 0;
  background-color: var(--button-bg);
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.3s ease;
}

.forgot-password a:hover {
  color: var(--button-bg);
}

.forgot-password a:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

.dark-mode .forgot-password a:hover {
  color: var(--text-primary);
}

.dark-mode .forgot-password a::after {
  background-color: var(--text-primary);
}

/* Button Styles */
.continue-btn {
  width: 100%;
  padding: 16px;
  margin-top: 24px;
  background-color: var(--button-bg);
  color: var(--button-text);
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.continue-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

.dark-mode .continue-btn::after {
  background: rgba(0, 0, 0, 0.3);
}

.continue-btn:hover {
  background-color: var(--button-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--shadow-color);
}

.continue-btn:active,
.continue-btn.pressed {
  transform: translateY(1px);
  box-shadow: 0 2px 8px var(--shadow-color);
}

.continue-btn:active::after {
  animation: ripple 1s;
  opacity: 0;
}

.continue-btn.loading::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: var(--button-text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn-text {
  margin-right: 8px;
  transition: transform 0.3s ease;
}

.btn-icon {
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
}

.continue-btn:hover .btn-text {
  transform: translateX(-4px);
}

.continue-btn:hover .btn-icon {
  opacity: 1;
  transform: translateX(0);
}

.continue-btn.loading .btn-text,
.continue-btn.loading .btn-icon {
  opacity: 0;
}

/* Social Login Styles */
.social-login {
  width: 100%;
  margin: 8px 0 46px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.social-btn {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1.5px solid var(--border-color);
  background-color: var(--alt-button-bg);
  color: var(--text-primary);
}

.social-btn:hover {
  background-color: var(--alt-button-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-color);
}

.social-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px var(--shadow-color);
}

.social-icon {
  width: 18px;
  height: 18px;
}

.dark-mode .social-icon {
  --icon-filter: invert(1);
}

.apple-btn .social-icon {
  filter: brightness(0);
}

.dark-mode .apple-btn .social-icon {
  filter: brightness(0) invert(1);
}

/* Turnstile Widget Styles */
#myWidget {
  margin-top: 12px;
  transition: all 0.3s ease;
  position: relative;
}

#myWidget.error {
  border: 1.5px solid #ff3b30;
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 0 0 1px rgba(255, 59, 48, 0.1);
}

.turnstile-error {
  color: #ff3b30;
  font-size: 13px;
  margin-top: 8px;
  display: block;
  animation: fadeIn 0.3s ease-out;
  text-align: center;
  font-weight: 500;
  letter-spacing: -0.2px;
  line-height: 1.2;
}

/* Cap widget container */
#capWidgetContainer {
  margin-top: 10px;
}

/* Error and feedback styling for Cap widget container */
#capWidgetContainer.error {
  border: 1.5px solid #ff3b30;
  border-radius: 12px;
  padding: 6px;
}

#capWidgetContainer.shake {
  animation: shake 0.4s ease-in-out;
}

/* Customize Cap widget visuals */
cap-widget {
  --cap-background: var(--card-bg);
  --cap-border-color: var(--border-color);
  --cap-border-radius: 12px;
  --cap-widget-height: 64px;
  --cap-widget-width: 100%;
  --cap-widget-padding: 10px;
  --cap-gap: 12px;
  --cap-color: var(--text-primary);
  --cap-checkbox-size: 20px;
  --cap-checkbox-border: 1px solid var(--border-color);
  --cap-checkbox-border-radius: 6px;
  --cap-checkbox-background: var(--input-bg);
  --cap-checkbox-margin: 2px;
  --cap-font: "Exo 2", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  --cap-spinner-color: var(--button-bg);
  --cap-spinner-background-color: var(--divider-color);
  --cap-spinner-thickness: 3px;
}

/* Hide Cap attribution link inside the widget */
cap-widget::part(attribution) {
  display: none !important;
}

/* Turnstile widget spacing */
#verificationWidget {
  margin-top: 12px;
  transition: all 0.3s ease;
  position: relative;
}

/* Error styling for verification */
#verificationWidget ~ .error-message {
  margin-top: -16px;
  margin-bottom: 16px;
}

/* Verification Code Styles */
.verification-form {
  width: 100%;
  margin-top: 16px;
  animation: fadeIn 0.5s ease-out forwards;
}

.verification-inputs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-left: 10px;
  padding-right: 10px;
}

.verification-code {
  width: 50px;
  height: 50px;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  background: var(--input-bg);
  color: var(--text-primary);
  transition: all 0.3s ease;
  caret-color: var(--button-bg);
  user-select: none;
  appearance: textfield;
  -moz-appearance: textfield;
}

.verification-code::-webkit-outer-spin-button,
.verification-code::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.verification-code::placeholder {
  color: transparent;
}

.verification-code:focus {
  outline: none;
  border-color: var(--focus-color);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.verification-inputs.error .verification-code {
  border-color: #ff3b30;
  box-shadow: 0 0 0 1px rgba(255, 59, 48, 0.1);
  animation: shake 0.4s ease-in-out;
}

.verification-inputs.verifying .verification-code {
  opacity: 0.7;
  pointer-events: none;
}

.verification-inputs.success .verification-code {
  border-color: #34c759;
  background-color: rgba(52, 199, 89, 0.1);
  animation: success 0.5s ease-out forwards;
}

@keyframes success {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 0.6;
  }
}

.verify-btn {
  width: 100%;
  margin-top: 24px;
  padding: 16px;
  background-color: var(--button-bg);
  color: var(--button-text);
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.verify-btn:hover {
  background-color: var(--button-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--shadow-color);
}

.verify-btn.loading {
  pointer-events: none;
}

.verify-btn.loading .btn-text {
  opacity: 0;
}

.verify-btn.loading::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: var(--button-text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.resend-text {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-secondary);
}

#resendLink {
  color: var(--link-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

#resendLink:hover {
  color: var(--button-bg);
}

.dark-mode #resendLink:hover {
  color: var(--text-primary);
}

/* Footer */
.footer {
  margin-top: 44px;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  padding-bottom: 10px;
}

.create-account {
  color: var(--link-color);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
  position: relative;
}

.create-account::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 1px;
  bottom: -2px;
  left: 0;
  background-color: var(--button-bg);
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.3s ease;
}

.create-account:hover {
  color: var(--button-bg);
}

.create-account:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

.dark-mode .create-account:hover {
  color: var(--text-primary);
}

.dark-mode .create-account::after {
  background-color: var(--text-primary);
}

.secured-by {
  display: flex;
  color: var(--text-primary);
  align-items: center;
  gap: 6px;
  font-size: 12px;
  opacity: 0.8;
  transition: opacity 0.3s ease;
  line-height: 1;
}

.secured-by:hover {
  opacity: 1;
}

.crox-logo {
  width: 18px;
  height: 18px;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.secured-by:hover .crox-logo {
  transform: rotate(10deg);
}

.crox-text {
  font-weight: 600;
}

.dark-mode .crox-logo {
  --logo-filter: brightness(0.9) invert(0.9);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  100% {
    transform: scale(20, 20);
    opacity: 0;
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-5px);
  }
  40%,
  80% {
    transform: translateX(5px);
  }
}

/* Additional animation for input groups */
.input-group.shake {
  animation: shake 0.4s ease-in-out;
}

/* Bottom Sheet Styles */
.sheet-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: none;
  z-index: 999;
}

.sheet-backdrop.visible {
  opacity: 1;
}

.bottom-sheet {
  display: none;
  position: fixed;
  bottom: -100%;
  left: 0;
  width: 100%;
  background-color: var(--card-bg);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: 0 -10px 30px var(--shadow-color);
  overflow: hidden;
  transition: bottom 0.3s ease;
  z-index: 1000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.drag-handle {
  width: 36px;
  height: 4px;
  background-color: var(--border-color);
  border-radius: 10px;
  cursor: grab;
  margin: 0 auto;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.close-btn:hover {
  background-color: var(--alt-button-bg);
}

.sheet-content {
  padding: 24px 20px;
  text-align: center;
}

.error-icon {
  font-size: 48px;
  color: #ff3b30;
  margin-bottom: 16px;
}

.sheet-content h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.sheet-content p {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
  padding: 0 16px;
}

/* Responsive Styles */
@media (max-width: 480px) {
  body {
    padding: 0;
    overflow: hidden;
  }

  .login-wrapper {
    align-items: stretch;
    padding: 0;
    height: 100%;
  }

  .login-container {
    height: 100%;
  }

  .login-card {
    max-width: 100%;
    height: 100%;
    padding: 24px 20px;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
    animation: none;
  }

  .continue-btn {
    margin-top: 20px;
    padding: 16px;
  }

  h1 {
    font-size: 22px;
    margin: 16px 0 8px;
  }

  .subtitle {
    font-size: 15px;
    margin-bottom: 20px;
  }

  input[type="email"],
  input[type="password"] {
    padding: 16px 16px 16px 44px;
    font-size: 15px;
  }

  input[type="password"] {
    padding-right: 44px;
  }

  .input-icon-wrapper {
    left: 14px;
    width: 16px;
    height: 16px;
  }

  .password-toggle {
    right: 14px;
  }

  .footer {
    margin-top: auto;
    padding-bottom: 24px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  /* Mobile verification form styles */
  .verification-form {
    width: 100%;
    padding: 0 12px;
    margin-top: 32px;
  }

  .verification-inputs {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin: 0 auto;
    width: 100%;
    max-width: 360px;
    padding: 0;
  }

  .verification-code {
    width: 100%;
    aspect-ratio: 1;
    height: auto;
    font-size: 28px;
    font-weight: 600;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-width: 2px;
  }

  .verify-btn {
    margin-top: 36px;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
    height: 60px;
    font-size: 18px;
    font-weight: 600;
  }

  .resend-text {
    margin-top: 28px;
    font-size: 15px;
  }

  #verificationWidget {
    margin-top: 28px;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
  }
}