@font-face {
  font-family: "DanaX";
  src: url("./dana medium.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "VazirDigits";
  src: url("./Vazir-Bold-FD-WOL.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-solid: #ffffff;
  --text-primary: #5d5d5d;
  --text-secondary: rgba(93, 93, 93, 0.75);
  --highlight: #79c52e;
  --danger: #d93025;
  --white: #ffffff;
  --font-base: "DanaX", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-digits: "VazirDigits", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: clamp(15px, calc(14px + 0.3vw), 18px);
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
}

body {
  font-family: var(--font-base);
  background: var(--bg-solid);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 3vh, 2rem) clamp(0.75rem, 3vw, 2rem);
  gap: 1.5rem;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 100vh;
}

.auth-layout {
  width: min(520px, 100%);
  max-width: min(520px, 92vw);
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1 0 auto;
  margin: 0 auto;
  min-height: 0;
}

.glass-card {
  width: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}


.brand {
  text-align: center;
  position: relative;
  z-index: 100;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.brand__logo {
  width: clamp(90px, 12vw, 120px);
  height: clamp(90px, 12vw, 120px);
  object-fit: contain;
  margin: 0;
}

.brand__title {
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  font-weight: 400;
  margin: 0 0 clamp(0.25rem, 1vh, 0.5rem);
  color: var(--text-primary);
}

.brand__subtitle {
  margin: 0;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  color: var(--text-secondary);
  font-weight: 400;
}

.auth__form,
.phone-section,
.otp-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-label {
  font-size: clamp(1rem, 2.5vw, 1.1rem);
  font-weight: 400;
  color: var(--text-primary);
  text-align: right;
  margin: 0;
  padding: 0;
}

.phone-box {
  direction: ltr;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(0.25rem, 0.8vw, 0.6rem);
  padding: 0;
  width: 100%;
  flex-wrap: nowrap;
}

.phone-box .digit.prefix + .digit.prefix {
  margin-left: calc(-1 * clamp(0.15rem, 0.5vw, 0.3rem));
}

.digit {
  width: clamp(0.8rem, 4vw, 1.4rem);
  min-width: clamp(0.8rem, 4vw, 1.4rem);
  max-width: clamp(0.9rem, 5vw, 1.4rem);
  background: transparent;
  border: none;
  border-bottom: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: 0;
  height: 2.5rem;
  font-size: clamp(1rem, 3vw, 1.45rem);
  text-align: center;
  font-family: var(--font-digits);
  font-weight: 400;
  color: var(--text-primary);
  outline: none;
  caret-color: #79c52e;
  padding: 0;
  margin: 0;
  vertical-align: baseline;
  flex-shrink: 0;
}

.digit:focus {
  border-bottom-color: #79c52e;
}

.digit.prefix {
  border-bottom: 2px solid #79c52e;
  color: var(--text-primary);
  pointer-events: none;
  margin: 0;
  padding: 0;
}

.digit:not(.prefix).filled {
  border-bottom-color: #79c52e;
}

.otp-box {
  direction: ltr;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(0.75rem, 3vw, 1.35rem);
  padding: 0;
  width: 100%;
}

.otp-digit {
  width: clamp(2.8rem, 9vw, 3.3rem);
  height: clamp(2.8rem, 9vw, 3.3rem);
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  text-align: center;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  outline: none;
  background: transparent;
  font-family: var(--font-digits);
  font-weight: 400;
  color: var(--text-primary);
  caret-color: #79c52e;
}

.otp-digit:focus,
.otp-digit.filled {
  border-color: #79c52e;
}

.primary-btn {
  border: none;
  border-radius: 999px;
  padding: clamp(0.75rem, 2vh, 1rem);
  background: #79c52e;
  color: #f5f5f5;
  font-size: clamp(0.9rem, 2vw, 1rem);
  font-weight: 400;
  font-family: var(--font-base);
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

.primary-btn:hover:not(:disabled),
.primary-btn:focus-visible:not(:disabled) {
  background: #69b020;
}

.primary-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.back-btn {
  border: none;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  background: transparent;
  color: var(--text-primary);
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  font-weight: 400;
  font-family: var(--font-base);
  cursor: pointer;
  transition: opacity 0.2s ease;
  align-self: flex-start;
  margin: 0 0 0.5rem 0;
}

.back-btn:hover {
  opacity: 0.7;
}

.otp-timer {
  text-align: center;
  margin-top: 0.5rem;
}

.timer-text {
  font-size: clamp(0.8rem, 2vw, 0.9rem);
  color: var(--text-secondary);
  font-weight: 400;
  font-family: var(--font-base);
}

.resend-btn {
  border: none;
  border-radius: 999px;
  padding: 0.6rem;
  background: transparent;
  color: var(--text-primary);
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  font-weight: 400;
  font-family: var(--font-base);
  cursor: pointer;
  transition: opacity 0.2s ease;
  text-decoration: none;
  margin: 0.5rem 0 0 0;
}

.resend-btn:hover:not(:disabled) {
  opacity: 0.7;
}

.resend-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.resend-hint {
  font-size: clamp(0.8rem, 2vw, 0.9rem);
  color: var(--text-secondary);
  text-align: center;
  margin: 0.5rem 0 0 0;
  padding: 0;
}

.hidden {
  display: none;
}

.status-message {
  width: 100%;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  text-align: center;
  color: var(--text-secondary);
  font-weight: 400;
  margin: 0;
  padding: 0.5rem 0;
  line-height: 1.6;
  word-break: break-word;
  white-space: normal;
}

.status-message.hidden {
  display: none;
}

.status-message:empty {
  display: none;
}

.status-message.success {
  color: var(--highlight);
}

.status-message.error {
  color: var(--danger);
}

/* Captcha Modal */
.captcha-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.3s ease;
}

.captcha-modal.hidden {
  display: none;
}

.captcha-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(8px) saturate(150%);
  -webkit-backdrop-filter: blur(8px) saturate(150%);
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.captcha-modal-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: min(420px, 90vw);
  max-height: 90vh;
  backdrop-filter: blur(25px) saturate(200%);
  -webkit-backdrop-filter: blur(25px) saturate(200%);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.15) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-top: 1.5px solid rgba(255, 255, 255, 0.5);
  border-left: 1.5px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.2),
    0 4px 16px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -1px 0 rgba(255, 255, 255, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.captcha-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(1rem, 2vh, 1.5rem) clamp(1.25rem, 3vw, 1.75rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.captcha-modal-title {
  margin: 0;
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  font-weight: 400;
  color: var(--text-primary);
  font-family: var(--font-base);
}

.captcha-modal-close {
  background: transparent;
  border: none;
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  width: clamp(2rem, 4vw, 2.5rem);
  height: clamp(2rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.3s ease;
  line-height: 1;
  font-family: system-ui, -apple-system, sans-serif;
}

.captcha-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  transform: rotate(90deg);
}

.captcha-modal-body {
  padding: clamp(1.25rem, 3vh, 2rem) clamp(1.25rem, 3vw, 1.75rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1rem, 2vh, 1.5rem);
}

.captcha-modal-description {
  margin: 0;
  font-size: clamp(0.9rem, 2vw, 1rem);
  color: var(--text-secondary);
  font-weight: 400;
  font-family: var(--font-base);
  text-align: center;
}

.captcha-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: clamp(0.5rem, 1vh, 0.75rem);
  width: 100%;
}

.captcha-container .g-recaptcha {
  transform: scale(0.95);
  transform-origin: center;
}

@media (max-width: 480px) {
  .captcha-modal-content {
    max-width: 95vw;
    border-radius: 20px;
  }
  
  .captcha-modal-header {
    padding: clamp(0.875rem, 2vh, 1.25rem) clamp(1rem, 2.5vw, 1.5rem);
  }
  
  .captcha-modal-body {
    padding: clamp(1rem, 2.5vh, 1.5rem) clamp(1rem, 2.5vw, 1.5rem);
  }
  
  .captcha-container .g-recaptcha {
    transform: scale(0.9);
  }
}

@media (max-width: 360px) {
  .captcha-container .g-recaptcha {
    transform: scale(0.85);
  }
}


.trust-strip__title {
  margin: 0;
  font-size: clamp(0.8rem, 2vw, 0.95rem);
  color: var(--text-secondary);
  font-weight: 400;
  text-align: center;
}

.trust-strip__slots {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(0.5rem, 2vw, 1rem);
  align-items: center;
  justify-items: center;
  visibility: hidden;
}

.trust-slot {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

@media (max-width: 768px) {
  .auth-layout {
    max-width: min(520px, 96vw);
  }

  .brand__title {
    font-size: clamp(1.2rem, 4vw, 1.4rem);
  }

  .brand__subtitle {
    font-size: clamp(0.8rem, 3.5vw, 0.95rem);
  }

  .primary-btn,
  .resend-btn {
    font-size: clamp(0.85rem, 3.2vw, 0.95rem);
  }

  .phone-box {
    gap: clamp(0.2rem, 0.7vw, 0.5rem);
  }

  .digit {
    width: clamp(0.75rem, 3.8vw, 1.3rem);
    min-width: clamp(0.75rem, 3.8vw, 1.3rem);
    font-size: clamp(0.95rem, 4.2vw, 1.4rem);
  }
}

@media (max-width: 480px) {
  body {
    padding: clamp(0.75rem, 3vw, 1.5rem) clamp(0.75rem, 3vw, 1.5rem);
  }

  .auth-layout {
    width: 100%;
    max-width: 100%;
  }

  .phone-box {
    gap: clamp(0.15rem, 0.6vw, 0.35rem);
    padding: 0;
    justify-content: center;
  }

  .otp-box {
    gap: clamp(0.5rem, 2vw, 1rem);
  }

  .digit {
    width: clamp(0.7rem, 3.5vw, 1.2rem);
    min-width: clamp(0.7rem, 3.5vw, 1.2rem);
    max-width: clamp(0.8rem, 4vw, 1.2rem);
    height: 2.2rem;
    font-size: clamp(0.9rem, 4.5vw, 1.3rem);
    flex-shrink: 0;
  }

  .otp-digit {
    width: clamp(2.5rem, 12vw, 3.5rem);
    height: clamp(2.5rem, 12vw, 3.5rem);
    font-size: clamp(1rem, 5vw, 1.4rem);
  }

  .trust-strip__slots {
    gap: clamp(0.3rem, 1.5vw, 0.6rem);
  }

  .trust-slot {
    max-width: 100%;
    height: auto;
  }
}

.page-footer {
  text-align: center;
  color: rgba(15, 81, 50, 0.7);
  font-size: clamp(0.7rem, 1.5vw, 0.85rem);
  font-weight: 400;
  padding-top: 1rem;
  margin-top: 0;
  width: 100%;
  max-width: min(640px, 96vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}


.page-footer .trust-strip__slots {
  width: 100%;
  max-width: 100%;
  margin: 0.5rem 0 0 0;
}

.page-footer small {
  margin-top: 0.5rem;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


::selection {
  background-color: var(--highlight);
  color: var(--white);
}