/* ==========================================================================
   CRM Project - Auth pages (Login, Register, Forgot, Reset)
   ========================================================================== */

:root {
  --auth-purple: #7367f0;
  --auth-purple-dark: #5e50ee;
  --auth-purple-light: #8f85f3;
  --auth-gradient: linear-gradient(135deg, #7367f0 0%, #9e95f5 50%, #b4a9f8 100%);
  --auth-card-radius: 20px;
  --auth-input-radius: 10px;
  --auth-text-dark: #1a1a2e;
  --auth-text-muted: #6b7280;
  --auth-border: #e5e7eb;
  --auth-link: #7367f0;
}

.auth-body {
  min-height: 100vh;
  background: var(--auth-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  font-family: 'Inter', sans-serif;
}

/* Register page uses solid purple bg */
.auth-body.auth-body-solid {
  background: var(--auth-purple);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: var(--auth-card-radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  padding: 2.5rem 2rem;
}

.auth-card.auth-card-wide {
  max-width: 620px;
  padding: 1.75rem 2.25rem;
}

/* Brand header */
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  margin-bottom: 1rem;
}

.auth-brand-icon {
  width: 40px;
  height: 40px;
  background: var(--auth-purple);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.auth-brand-text {
  text-align: left;
}

.auth-brand-text .brand-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--auth-text-dark);
  line-height: 1.2;
  display: block;
}

.auth-brand-text .brand-tagline {
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--auth-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
}

.auth-brand-text .brand-sub {
  font-size: 0.75rem;
  color: var(--auth-text-muted);
  display: block;
  line-height: 1.2;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--auth-text-dark);
  text-align: center;
  margin-bottom: 0.375rem;
}

.auth-subtitle {
  font-size: 0.875rem;
  color: var(--auth-text-muted);
  text-align: center;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

/* Form */
.auth-form .form-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.375rem;
}

.auth-form .form-label .label-hint {
  font-weight: 400;
  color: var(--auth-text-muted);
  font-size: 0.6875rem;
}

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

.auth-input-wrap .input-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 1rem;
  z-index: 2;
  pointer-events: none;
}

.auth-input-wrap .form-control {
  padding: 0.625rem 0.875rem 0.625rem 2.5rem;
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-input-radius);
  font-size: 0.875rem;
  height: 42px;
  color: var(--auth-text-dark);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input-wrap .form-control:focus {
  border-color: var(--auth-purple);
  box-shadow: 0 0 0 3px rgba(115, 103, 240, 0.15);
}

.auth-input-wrap .form-control::placeholder {
  color: #c4c9d4;
}

.auth-input-wrap .password-toggle {
  position: absolute;
  right: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #9ca3af;
  padding: 0;
  cursor: pointer;
  z-index: 2;
  line-height: 1;
}

.auth-input-wrap .password-toggle:hover {
  color: var(--auth-purple);
}

.auth-input-wrap.has-toggle .form-control {
  padding-right: 2.5rem;
}

/* Plan selection (register) */
.plan-selection {
  margin-bottom: 1.25rem;
}

.plan-selection .plan-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.625rem;
}

.plan-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.plan-option {
  flex: 1;
  position: relative;
  margin-bottom: 0;
}

.plan-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.plan-option .plan-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 0.5rem;
  border: 1.5px solid var(--auth-border);
  border-radius: var(--auth-input-radius);
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.plan-option .plan-card::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid #d1d5db;
  border-radius: 50%;
  flex-shrink: 0;
  transition: all 0.2s;
}
.plan-option .plan-card:hover {
  border-color: var(--auth-purple-light);
}

.plan-option input:focus-visible + .plan-card {
  border-color: var(--auth-purple);
  box-shadow: 0 0 0 3px rgba(115, 103, 240, 0.15);
}

.plan-option input:checked + .plan-card {
  border-color: var(--auth-purple);
  background: rgba(115, 103, 240, 0.04);
  color: var(--auth-purple);
}

.plan-option input:checked + .plan-card::before {
  border-color: var(--auth-purple);
  background: var(--auth-purple);
  box-shadow: inset 0 0 0 3px #fff;
}

/* Remember / forgot row */
.auth-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  font-size: 0.8125rem;
}

.auth-options-row .form-check-label {
  color: var(--auth-text-muted);
}

.auth-options-row .form-check-input:checked {
  background-color: var(--auth-purple);
  border-color: var(--auth-purple);
}

.auth-link {
  color: var(--auth-link);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.8125rem;
}

.auth-link:hover {
  color: var(--auth-purple-dark);
  text-decoration: underline;
}

/* Submit button */
.btn-auth-submit {
  width: 100%;
  height: 48px;
  background: var(--auth-purple);
  border: none;
  border-radius: var(--auth-input-radius);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  transition: background 0.2s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-auth-submit:hover {
  background: var(--auth-purple-dark);
  color: #fff;
}

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

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

/* Footer link */
.auth-footer-link {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--auth-text-muted);
}

.auth-footer-link a {
  color: var(--auth-link);
  font-weight: 600;
  text-decoration: none;
}

.auth-footer-link a:hover {
  text-decoration: underline;
}

@media (max-width: 575.98px) {
  .auth-card {
    padding: 2rem 1.25rem;
  }

  .auth-card.auth-card-wide {
    padding: 2rem 1.25rem;
  }

  .plan-options {
    flex-direction: column;
  }
}
