/* ============================================================
   Remowork – Auth Pages CSS
   Colors: Navy #0D2481 | Accent Blue #1B3FBE | Pink #E31B7B
   ============================================================ */

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

:root {
  --navy:       #0D2481;
  --blue:       #1B3FBE;
  --blue-light: #2B52D4;
  --pink:       #E31B7B;
  --pink-light: #FF2D8A;
  --gray-50:    #F8F9FF;
  --gray-100:   #EEF0F8;
  --gray-200:   #D9DCF0;
  --gray-400:   #9098C0;
  --gray-600:   #5A6390;
  --gray-800:   #2A2F52;
  --white:      #FFFFFF;
  --danger:     #D32F2F;
  --success:    #1E8A4C;

  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --shadow-card: 0 8px 40px rgba(13,36,129,.13), 0 2px 8px rgba(13,36,129,.07);
  --transition: .2s ease;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ─────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #EEF1FF 0%, #F5F7FF 50%, #EBF0FF 100%);
}

.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .35;
  pointer-events: none;
  z-index: 0;
}
.bg-blob-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #1B3FBE 0%, transparent 70%);
  top: -180px; left: -160px;
}
.bg-blob-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #E31B7B 0%, transparent 70%);
  bottom: -140px; right: -120px;
}

/* ── Card ────────────────────────────────────────────────── */
.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 48px 44px;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
  animation: slideUp .4s ease both;
}

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

/* ── Logo ────────────────────────────────────────────────── */
.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}
.logo-icon svg { display: block; }
.logo-text {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.5px;
}

/* ── Title ───────────────────────────────────────────────── */
.auth-title {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--gray-800);
  text-align: center;
  margin-bottom: 6px;
}
.auth-subtitle {
  text-align: center;
  color: var(--gray-600);
  font-size: .9rem;
  margin-bottom: 28px;
}

/* ── Form ────────────────────────────────────────────────── */
.auth-form { display: flex; flex-direction: column; gap: 18px; }

.form-group { display: flex; flex-direction: column; gap: 6px; position: relative; }

.floating-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--gray-600);
  letter-spacing: .3px;
  text-transform: uppercase;
}
.required { color: var(--pink); }

.input-wrapper { position: relative; }

.form-input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-family: inherit;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
select.form-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%234A5568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  padding-right: 40px;
  cursor: pointer;
}
select.form-input option {
  background-color: var(--white);
  color: var(--gray-800);
}
.form-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(27,63,190,.12);
}
.form-input.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(211,47,47,.10);
}
.input-wrapper .form-input { padding-right: 48px; }

.toggle-password {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color var(--transition);
}
.toggle-password:hover { color: var(--blue); }

.field-error {
  font-size: .78rem;
  color: var(--danger);
  display: none;
}
.field-error.visible { display: block; }

/* ── Links ───────────────────────────────────────────────── */
.forgot-link {
  font-size: .85rem;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  align-self: flex-start;
  margin-top: -8px;
  transition: color var(--transition);
}
.forgot-link:hover { color: var(--navy); text-decoration: underline; }

/* ── Button ──────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  margin-top: 4px;
  position: relative;
  overflow: hidden;
}
.btn-primary:hover {
  background: var(--blue-light);
  box-shadow: 0 4px 18px rgba(27,63,190,.35);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); box-shadow: none; }
.btn-primary:disabled { opacity: .65; cursor: not-allowed; transform: none; }

/* Loading spinner inside button */
.btn-primary .spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto;
}
.btn-primary.loading .btn-text { display: none; }
.btn-primary.loading .spinner  { display: block; }

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

/* ── Divider ─────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gray-400);
  font-size: .82rem;
  font-weight: 500;
  margin: 4px 0;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

/* ── Auth Switch Link ────────────────────────────────────── */
.auth-switch {
  text-align: center;
  font-size: .88rem;
  color: var(--gray-600);
  margin-top: 8px;
}
.auth-switch a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
  transition: color var(--transition);
}
.auth-switch a:hover { color: var(--navy); text-decoration: underline; }

/* ── Alert Banner ────────────────────────────────────────── */
.alert-banner {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  display: none;
  margin-bottom: 4px;
}
.alert-banner.error { background: #FFFFFF; color: #D92D20; border: 1px solid #FDA29B; box-shadow: 0 1px 2px rgba(16,24,40,0.05); display: block; }
.alert-banner.success { background: #FFFFFF; color: #039855; border: 1px solid #75E0A7; box-shadow: 0 1px 2px rgba(16,24,40,0.05); display: block; }

/* ── Password Strength ───────────────────────────────────── */
.password-strength { margin-top: 6px; }
.strength-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
}
.strength-segment {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--gray-200);
  transition: background .3s;
}
.strength-segment.weak    { background: #E53935; }
.strength-segment.fair    { background: #FB8C00; }
.strength-segment.good    { background: #43A047; }
.strength-segment.strong  { background: #1B3FBE; }
.strength-label {
  font-size: .75rem;
  color: var(--gray-600);
}

/* ── Terms ───────────────────────────────────────────────── */
.terms-text {
  font-size: .78rem;
  color: var(--gray-600);
  text-align: center;
  line-height: 1.5;
}
.terms-text a { color: var(--blue); text-decoration: none; font-weight: 500; }
.terms-text a:hover { text-decoration: underline; }

/* ── Reset Page ──────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  margin-bottom: 24px;
  transition: gap var(--transition), color var(--transition);
}
.back-link:hover { color: var(--navy); gap: 10px; }

.reset-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, #EEF1FF, #DBE3FF);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
  .auth-card { padding: 36px 24px; }
  .auth-title { font-size: 1.45rem; }
}

.input-help {
  font-size: .78rem;
  color: var(--gray-600);
  line-height: 1.45;
}

.input-help code {
  background: var(--gray-100);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: .75rem;
}

.btn-secondary {
  width: 100%;
  padding: 13px 14px;
  background: var(--white);
  color: var(--blue);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.btn-secondary:hover {
  border-color: var(--blue);
  background: #F7F9FF;
}

.btn-secondary:disabled {
  opacity: .65;
  cursor: not-allowed;
}

.code-input {
  text-align: center;
  letter-spacing: .32em;
  font-weight: 700;
  font-size: 1.05rem;
}

[hidden] {
  display: none !important;
}
