/* Login page — reuses tokens, body gradient & .page-glow from ../style.css */

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
  position: relative;
}

/* Back chevron (mirrors the app's top-left back button) */
.auth-back {
  position: absolute;
  top: 26px;
  left: 26px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.auth-back:hover {
  transform: translateX(-2px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

/* The card */
.auth-card {
  position: relative;
  width: min(440px, 100%);
  padding: 44px 38px 32px;
  border-radius: var(--radius);
  background:
    linear-gradient(160deg, rgba(47, 128, 255, 0.12), transparent 46%),
    var(--panel-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  overflow: hidden;
  animation: card-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* thin highlight line along the top edge */
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(92, 225, 255, 0.7),
    transparent
  );
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* staggered children */
.auth-card > * {
  animation: rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.auth-brand    { animation-delay: 0.06s; }
.auth-title    { animation-delay: 0.12s; }
.auth-sub      { animation-delay: 0.16s; }
.auth-form     { animation-delay: 0.22s; }
.auth-fineprint{ animation-delay: 0.30s; }

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

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.auth-brand .mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, var(--blue), #1559c9);
  box-shadow: 0 10px 26px rgba(47, 128, 255, 0.4);
}

.auth-title {
  font-size: 2rem;
  letter-spacing: -0.05em;
  line-height: 1.05;
}

.auth-sub {
  margin-top: 10px;
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.6;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.field-label {
  display: block;
  margin: 0 0 8px 2px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Input shells */
.input-shell {
  display: flex;
  align-items: center;
  height: 58px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.input-shell:focus-within {
  border-color: rgba(47, 128, 255, 0.7);
  box-shadow: 0 0 0 4px var(--blue-soft);
  background: rgba(47, 128, 255, 0.05);
}

.input-shell .lead-icon {
  display: grid;
  place-items: center;
  width: 52px;
  color: var(--muted);
  flex-shrink: 0;
}

.input-shell input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 14px 0 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1.02rem;
  font-family: inherit;
  outline: none;
}

.input-shell input::placeholder {
  color: rgba(154, 169, 195, 0.7);
}

/* Country code chip + phone */
.phone-shell .cc-select {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.phone-shell select {
  appearance: none;
  -webkit-appearance: none;
  height: 38px;
  margin: 0 4px 0 10px;
  padding: 0 30px 0 12px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(10, 20, 40, 0.85);
  color: var(--text);
  font-size: 0.96rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.phone-shell select:focus {
  border-color: rgba(47, 128, 255, 0.6);
}

.phone-shell .cc-select::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.phone-shell input {
  padding-left: 8px;
}

/* Password reveal */
.toggle-eye {
  display: grid;
  place-items: center;
  width: 52px;
  height: 100%;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.toggle-eye:hover {
  color: var(--text);
}

/* Error banner */
.auth-error {
  display: none;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  border-radius: 13px;
  border: 1px solid rgba(255, 90, 110, 0.4);
  background: rgba(255, 70, 90, 0.1);
  color: #ffc4cc;
  font-size: 0.9rem;
  line-height: 1.5;
}

.auth-error.show {
  display: flex;
  animation: rise 0.3s ease both;
}

.auth-error svg {
  flex-shrink: 0;
  margin-top: 1px;
}

/* Submit button */
.auth-submit {
  position: relative;
  height: 58px;
  margin-top: 4px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(180deg, #3a8bff, var(--blue));
  color: #fff;
  font-size: 1.08rem;
  font-weight: 800;
  font-family: inherit;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 16px 38px rgba(47, 128, 255, 0.38);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.auth-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 20px 46px rgba(47, 128, 255, 0.5);
}

.auth-submit:active:not(:disabled) {
  transform: translateY(0);
}

.auth-submit:disabled {
  cursor: progress;
  filter: saturate(0.7) brightness(0.9);
}

.auth-submit .btn-label.hide { visibility: hidden; }

.spinner {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  display: none;
  animation: spin 0.7s linear infinite;
}

.auth-submit.loading .spinner { display: block; }

@keyframes spin { to { transform: rotate(360deg); } }

.forgot-link {
  margin: 18px auto 4px;
  display: block;
  width: fit-content;
  color: var(--cyan);
  font-weight: 600;
  font-size: 0.96rem;
  transition: opacity 0.2s ease;
}

.forgot-link:hover { opacity: 0.8; }

.auth-fineprint {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

.auth-fineprint a {
  color: var(--cyan);
  font-weight: 600;
}

.auth-fineprint .signup-line {
  margin-top: 12px;
}

@media (max-width: 480px) {
  .auth-card { padding: 38px 24px 28px; }
  .auth-title { font-size: 1.8rem; }
  .auth-back { top: 16px; left: 16px; }
}
