/* Auth page styles — extends existing Kadopay design system */

.auth-field {
  margin-bottom: 1.25rem;
}

.auth-label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(51 65 85 / 1); /* ink-700 */
}

.auth-input-wrap {
  position: relative;
}

.auth-input {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid rgb(226 232 240 / 1); /* ink-200 */
  background-color: rgb(255 255 255 / 1);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: rgb(30 41 59 / 1); /* ink-800 */
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.auth-input::placeholder {
  color: rgb(148 163 184 / 1); /* ink-400 */
}

.auth-input:focus {
  border-color: rgb(52 211 153 / 1); /* brand-400 */
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1); /* brand-500/10 */
}

.auth-input.has-error {
  border-color: rgb(239 68 68 / 1); /* red-500 */
}

.auth-input-icon {
  position: absolute;
  left: 1.125rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  display: flex;
  align-items: center;
}

/* Ensure enough left padding so text doesn't crowd the icon */
.auth-input-wrap .auth-input {
  padding-left: 3rem; /* 48px — gives ~14px gap after a 16px icon at 18px left */
}

/* Dial code field is narrow + centered — keep icon spacing but reduce padding */
.auth-input-wrap .auth-input#su-dial-code {
  padding-left: 2.75rem; /* 44px */
  padding-right: 0.5rem;
}

.auth-toggle-password {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
}

.auth-error {
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: rgb(239 68 68 / 1); /* red-500 */
  display: none;
}

.auth-error.visible {
  display: block;
}

.auth-submit-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 9999px;
  background-color: rgb(15 23 42 / 1); /* ink-900 */
  padding: 0.875rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgb(255 255 255 / 1);
  border: none;
  cursor: pointer;
  transition: background-color 0.15s, transform 0.15s;
}

.auth-submit-btn:hover {
  background-color: rgb(30 41 59 / 1); /* ink-800 */
}

.auth-submit-btn:active {
  transform: scale(0.97);
}

.auth-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-btn-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Country dropdown — custom component */
.country-dropdown {
  position: relative;
  width: 100%;
}

.country-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0;
  border-radius: 0.75rem;
  border: 1px solid rgb(226 232 240 / 1); /* ink-200 */
  background-color: rgb(255 255 255 / 1);
  padding: 0.75rem 2.25rem 0.75rem 0;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  text-align: left;
}

.country-trigger:focus {
  border-color: rgb(52 211 153 / 1); /* brand-400 */
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.country-trigger.open {
  border-color: rgb(52 211 153 / 1); /* brand-400 */
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.country-trigger-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-left: 3rem;
  color: rgb(148 163 184 / 1); /* ink-400 — placeholder color */
}

.country-trigger-text.has-value {
  color: rgb(30 41 59 / 1); /* ink-800 */
}

.country-trigger .auth-input-icon {
  position: absolute;
  left: 1.125rem;
  pointer-events: none;
}

.country-trigger .auth-select-chevron {
  position: absolute;
  right: 0.875rem;
  transition: transform 0.2s;
}

.country-trigger.open .auth-select-chevron {
  transform: translateY(-50%) rotate(180deg);
}

/* Dropdown menu */
.country-menu {
  position: absolute;
  top: calc(100% + 0.375rem);
  left: 0;
  right: 0;
  z-index: 50;
  border-radius: 0.75rem;
  border: 1px solid rgb(226 232 240 / 1);
  background-color: rgb(255 255 255 / 1);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  display: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s;
  pointer-events: none;
}

.country-menu.open {
  display: block;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Search box inside dropdown */
.country-search-wrap {
  position: relative;
  padding: 0.5rem;
  border-bottom: 1px solid rgb(241 245 249 / 1); /* ink-100 */
}

.country-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.country-search {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid rgb(226 232 240 / 1);
  background-color: rgb(248 250 252 / 1); /* ink-50 */
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  font-size: 0.8125rem;
  color: rgb(30 41 59 / 1);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.country-search:focus {
  border-color: rgb(52 211 153 / 1);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.country-search::placeholder {
  color: rgb(148 163 184 / 1);
}

/* Scrollable options list */
.country-options {
  max-height: 16rem; /* 256px — fixed max height */
  overflow-y: auto;
  padding: 0.25rem;
}

/* Subtle scrollbar matching Kadopay design */
.country-options::-webkit-scrollbar {
  width: 6px;
}
.country-options::-webkit-scrollbar-track {
  background: transparent;
}
.country-options::-webkit-scrollbar-thumb {
  background-color: rgb(203 213 225 / 0.7); /* ink-300 */
  border-radius: 9999px;
}
.country-options::-webkit-scrollbar-thumb:hover {
  background-color: rgb(148 163 184 / 0.8); /* ink-400 */
}
.country-options {
  scrollbar-width: thin;
  scrollbar-color: rgb(203 213 225 / 0.7) transparent;
}

.country-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgb(30 41 59 / 1); /* ink-800 */
  cursor: pointer;
  transition: background-color 0.1s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.country-option:hover,
.country-option.highlighted {
  background-color: rgb(241 245 249 / 1); /* ink-100 */
}

.country-option.selected {
  background-color: rgba(16, 185, 129, 0.08);
  color: rgb(4 120 87 / 1); /* brand-700 */
}

.country-option-flag {
  font-size: 1.125rem;
  line-height: 1;
  flex-shrink: 0;
}

.country-option-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.country-option-dial {
  color: rgb(148 163 184 / 1); /* ink-400 */
  font-weight: 400;
  flex-shrink: 0;
  font-size: 0.75rem;
}

.country-option.no-match {
  padding: 1rem;
  text-align: center;
  color: rgb(148 163 184 / 1);
  font-weight: 400;
  cursor: default;
}
.country-option.no-match:hover {
  background: none;
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .country-options {
    max-height: 14rem;
  }
  .country-menu {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
  }
}

/* OTP input boxes */
.auth-otp-input {
  width: 3rem;
  height: 3.5rem;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  border-radius: 0.75rem;
  border: 1px solid rgb(226 232 240 / 1); /* ink-200 */
  background-color: rgb(255 255 255 / 1);
  color: rgb(15 23 42 / 1); /* ink-900 */
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-otp-input:focus {
  border-color: rgb(52 211 153 / 1); /* brand-400 */
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.auth-otp-input.has-error {
  border-color: rgb(239 68 68 / 1); /* red-500 */
}

@media (max-width: 400px) {
  .auth-otp-input {
    width: 2.5rem;
    height: 3rem;
    font-size: 1rem;
  }
}

/* Password strength indicator */
.auth-strength {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.25rem;
}

.auth-strength-bar {
  height: 3px;
  flex: 1;
  border-radius: 9999px;
  background-color: rgb(226 232 240 / 1); /* ink-200 */
  transition: background-color 0.2s;
}

.auth-strength-bar.weak { background-color: rgb(239 68 68 / 1); }
.auth-strength-bar.medium { background-color: rgb(245 158 11 / 1); }
.auth-strength-bar.strong { background-color: rgb(16 185 129 / 1); }

.auth-strength-label {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: rgb(148 163 184 / 1); /* ink-400 */
}

/* ── Password reset progress indicator ─────────────────── */
#reset-progress {
  display: flex;
}

#reset-progress > .flex {
  width: 100%;
  align-items: flex-start;
}

.reset-progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
}

.reset-progress-dot {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  background-color: rgb(241 245 249 / 1); /* ink-100 */
  color: rgb(148 163 184 / 1); /* ink-400 */
  border: 2px solid transparent;
  transition: all 0.2s;
}

.reset-progress-step.active .reset-progress-dot {
  background-color: rgb(16 185 129 / 1); /* brand-500 */
  color: rgb(255 255 255 / 1);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.reset-progress-step.completed .reset-progress-dot {
  background-color: rgb(16 185 129 / 1); /* brand-500 */
  color: rgb(255 255 255 / 1);
}

.reset-progress-label {
  font-size: 0.625rem;
  font-weight: 600;
  color: rgb(148 163 184 / 1); /* ink-400 */
  text-align: center;
  white-space: nowrap;
  transition: color 0.2s;
}

.reset-progress-step.active .reset-progress-label {
  color: rgb(4 120 87 / 1); /* brand-700 */
}

.reset-progress-step.completed .reset-progress-label {
  color: rgb(16 185 129 / 1); /* brand-500 */
}

.reset-progress-line {
  flex: 1;
  height: 2px;
  background-color: rgb(226 232 240 / 1); /* ink-200 */
  margin-top: 0.875rem;
  border-radius: 9999px;
  min-width: 0.5rem;
}

/* ── Password requirements ─────────────────────────────── */
.reset-password-requirements {
  margin-bottom: 1.25rem;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  background-color: rgb(248 250 252 / 1); /* ink-50 */
  border: 1px solid rgb(226 232 240 / 1); /* ink-200 */
}

.reset-req-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgb(51 65 85 / 1); /* ink-700 */
  margin-bottom: 0.5rem;
}

.reset-req-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.reset-req-list li {
  font-size: 0.75rem;
  color: rgb(148 163 184 / 1); /* ink-400 */
  padding-left: 1.25rem;
  position: relative;
  transition: color 0.2s;
}

.reset-req-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 9999px;
  border: 1.5px solid rgb(203 213 225 / 1); /* ink-300 */
  transition: all 0.2s;
}

.reset-req-list li.met {
  color: rgb(4 120 87 / 1); /* brand-700 */
}

.reset-req-list li.met::before {
  content: '\2713';
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 700;
  color: rgb(255 255 255 / 1);
  background-color: rgb(16 185 129 / 1); /* brand-500 */
  border-color: rgb(16 185 129 / 1);
}

/* ── Responsive progress indicator ─────────────────────── */
@media (max-width: 480px) {
  .reset-progress-dot {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.6875rem;
  }
  .reset-progress-label {
    font-size: 0.5625rem;
  }
  .reset-progress-line {
    margin-top: 0.75rem;
  }
}
