/* ── Auth Pages ───────────────────────────────────────────── */

.auth-root {
  min-height: 100vh; display: grid;
  grid-template-columns: 1fr 1fr;
}

/* ── Left Panel ─── brand/visual side */
.auth-panel-brand {
  background: var(--ink);
  display: flex; flex-direction: column;
  padding: 48px;
  position: relative; overflow: hidden;
}
.auth-panel-brand::before {
  content: '';
  position: absolute; top: -30%; right: -20%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(37,99,235,0.22) 0%, transparent 65%);
  border-radius: 50%; pointer-events: none;
}
.auth-panel-brand::after {
  content: '';
  position: absolute; bottom: -20%; left: -10%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 65%);
  border-radius: 50%; pointer-events: none;
}
.auth-brand-logo {
  display: flex; align-items: center; gap: 10px;
  color: #fff; font-weight: 700; font-size: 1.125rem;
  letter-spacing: -0.02em; position: relative; z-index: 1;
}
.auth-brand-logo-mark {
  width: 30px; height: 30px; background: var(--blue); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.auth-brand-content {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  position: relative; z-index: 1;
}
.auth-brand-tagline {
  font-size: clamp(1.8rem, 2.5vw, 2.4rem);
  font-weight: 700; color: #fff; letter-spacing: -0.03em;
  line-height: 1.15; margin-bottom: 16px;
}
.auth-brand-tagline span { color: rgba(37,99,235,0.9); }
.auth-brand-desc { font-size: 0.9375rem; color: rgba(255,255,255,0.5); line-height: 1.7; max-width: 380px; margin-bottom: 48px; }

/* Animated signature showcase on brand panel */
.auth-sig-showcase {
  display: flex; flex-direction: column; gap: 14px;
}
.auth-sig-item {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r-lg); padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
  backdrop-filter: blur(8px);
  transition: all var(--dur-mid) var(--ease);
}
.auth-sig-item:hover { background: rgba(255,255,255,0.1); }
.auth-sig-name { color: rgba(255,255,255,0.9); font-size: 1.6rem; line-height: 1; }
.auth-sig-meta { text-align: right; }
.auth-sig-style { font-size: 0.7rem; font-weight: 600; color: rgba(255,255,255,0.35); letter-spacing: 0.06em; text-transform: uppercase; }
.auth-sig-check {
  width: 20px; height: 20px; background: rgba(37,99,235,0.3); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; margin-top: 6px; margin-left: auto;
  color: rgba(255,255,255,0.8);
}

.auth-brand-footer {
  position: relative; z-index: 1;
  font-size: 0.8125rem; color: rgba(255,255,255,0.25);
}

/* ── Right Panel ─── form side */
.auth-panel-form {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  background: var(--bg); padding: 48px;
}
.auth-form-wrap { width: 100%; max-width: 400px; }
.auth-form-header { margin-bottom: 36px; }
.auth-form-header h1 { font-size: 1.625rem; font-weight: 700; letter-spacing: -0.025em; color: var(--ink); margin-bottom: 6px; }
.auth-form-header p  { font-size: 0.9rem; color: var(--ink-3); }

.auth-form { display: flex; flex-direction: column; gap: 18px; }
.auth-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Floating label inputs */
.field {
  position: relative;
}
.field-input {
  width: 100%; height: 52px; padding: 20px 14px 8px;
  background: var(--white); border: 1.5px solid var(--border-2);
  border-radius: var(--r-md); font-size: 0.9375rem; color: var(--ink);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  -webkit-appearance: none; outline: none;
}
.field-input::placeholder { color: transparent; }
.field-input:hover:not(:focus) { border-color: var(--ink-5); }
.field-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-ring); }
.field-label {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 0.9375rem; color: var(--ink-4); font-weight: 400;
  pointer-events: none;
  transition: all var(--dur-fast) var(--ease);
  transform-origin: left center;
}
.field-input:focus + .field-label,
.field-input:not(:placeholder-shown) + .field-label,
.field-input:-webkit-autofill + .field-label {
  top: 8px; transform: translateY(0) scale(0.74);
  color: var(--blue); font-weight: 600;
}
.field-input:not(:focus):not(:placeholder-shown) + .field-label,
.field-input:not(:focus):-webkit-autofill + .field-label { color: var(--ink-3); }

/* Password toggle */
.field-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--ink-4); cursor: pointer; padding: 4px;
  transition: color var(--dur-fast);
}
.field-toggle:hover { color: var(--ink-2); }

/* Auth submit button */
.auth-submit { height: 52px; font-size: 0.9375rem; font-weight: 600; border-radius: var(--r-md); }
.auth-submit .btn-text { transition: opacity var(--dur-fast); }
.auth-submit .btn-spinner { display: none; }
.auth-submit.loading .btn-text { opacity: 0; }
.auth-submit.loading .btn-spinner { display: flex; position: absolute; }

/* Auth footer links */
.auth-footer-link {
  text-align: center; margin-top: 24px;
  font-size: 0.875rem; color: var(--ink-3);
}
.auth-footer-link a { color: var(--blue); font-weight: 500; transition: color var(--dur-fast); }
.auth-footer-link a:hover { color: var(--blue-hover); text-decoration: underline; }

/* Forgot password */
.auth-forgot { display: flex; justify-content: flex-end; margin-top: -8px; }
.auth-forgot a { font-size: 0.8125rem; color: var(--ink-3); transition: color var(--dur-fast); }
.auth-forgot a:hover { color: var(--blue); }

/* Alert box */
.auth-alert {
  padding: 12px 16px; border-radius: var(--r-md);
  font-size: 0.875rem; font-weight: 450;
  display: flex; align-items: center; gap: 10px;
  animation: fade-up 0.25s var(--ease-out) both;
}
.auth-alert--error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.auth-alert--success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }

/* Mobile auth */
@media (max-width: 900px) {
  .auth-root {
    grid-template-columns: 1fr;
    min-height: 0;
    height: auto;
  }
  .auth-panel-brand { display: none; }
  .auth-panel-form {
    padding: 24px 20px 36px;
    justify-content: center;
    min-height: 0;
    flex: 1;
  }
}
@media (max-width: 480px) {
  .auth-form-row { grid-template-columns: 1fr; }
  .auth-panel-form { padding: 16px 12px 28px; }
}

/* ── Embedded Mobile Showcase ── */
.auth-mobile-showcase {
  display: none;
}

@media (max-width: 900px) {
  .auth-mobile-showcase {
    display: block;
    width: 100%;
    margin-bottom: 28px;
  }
  .auth-mobile-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--ink);
    font-weight: 700;
    font-size: 0.9375rem;
    margin-bottom: 12px;
  }
  .auth-mobile-logo-mark {
    width: 24px;
    height: 24px;
    background: var(--blue);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .auth-mobile-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
    text-align: center;
    margin-bottom: 18px;
    letter-spacing: -0.025em;
  }
  .auth-mobile-title span {
    color: var(--blue);
  }
  .auth-mobile-sig-canvas {
    background: var(--bg);
    border: 1px solid var(--border-2);
    border-radius: var(--r-xl);
    padding: 16px 20px;
    margin-bottom: 18px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .auth-mobile-sig-canvas-line {
    width: 80%;
    height: 1px;
    background: var(--border-2);
    margin-top: -4px;
    margin-bottom: 6px;
  }
  .auth-mobile-sig-canvas-label {
    font-size: 0.65rem;
    color: var(--ink-4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
  }
  .auth-mobile-sig-svg {
    width: 100%;
    max-width: 200px;
    height: 68px;
  }
  .auth-mobile-sig-svg path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: write-mobile-sig 4s ease-in-out infinite;
  }
  @keyframes write-mobile-sig {
    0% { stroke-dashoffset: 1000; }
    10% { stroke-dashoffset: 1000; }
    65% { stroke-dashoffset: 0; }
    85% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 1000; }
  }
  .auth-mobile-sig-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .auth-mobile-sig-card {
    background: var(--white);
    border: 1px solid var(--border-2);
    border-radius: var(--r-lg);
    padding: 8px 4px;
    text-align: center;
    box-shadow: var(--shadow-sm);
  }
  .auth-mobile-sig-card-name {
    font-size: 1.05rem;
    color: var(--ink-2);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .auth-mobile-sig-card-style {
    font-size: 0.58rem;
    font-weight: 700;
    color: var(--ink-4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
}
