:root {
    --bg: #fff;
    --fg: #0a0a0a;
    --muted: #6b7280;
    --muted-2: #374151;
    --border: #e5e7eb;
    --card: #f9fafb;
    --brand-2: #0ea5e9;
    --shadow: 0 6px 24px rgba(0, 0, 0, .08);
    --radius: 14px;
    --spin-size: 42px;
    /* diameter */
    --spin-thickness: 3px;
    /* ring thickness */
    --spin-color: #0ea5e9;
    /* accent */
    --spin-track: #e5e7eb;
    /* background ring */
    --spin-speed: 900ms;
    /* rotation speed */
}

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

#displayMessages {

    text-align: center;
}

html,
body {
    height: 100%
}

body {
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    background: var(--bg);
    color: var(--fg);
    line-height: 1.6;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    /* background-image:
        linear-gradient(rgba(213, 214, 216, 0.12) 2px, transparent 1px),
        linear-gradient(90deg, rgba(213, 214, 216, 0.12) 2px, transparent 1px); */
    /* --gap: 28px;

    --dot: 2px;

    --dot-color: rgba(213, 214, 216, 0.25);

    background-image: radial-gradient(circle at 1px 1px, var(--dot-color) var(--dot), transparent var(--dot)); */
    background-size: 28px 28px;
    background-position: center
}

a {
    text-decoration: none;
    color: inherit
}

.nav {
    padding: 16px 20px
}

.brand {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800
}

.brand .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--brand-2)
}

/* .auth {
    display: grid;
    place-items: center;
    padding: 24px 20px 40px
} */

/* Center robustly across devices (uses dynamic viewport units) */
.auth{
  min-height: 100dvh;              /* iOS/Android modern */
  min-height: 100svh;              /* Safari fallback */
  display: grid;                   /* grid = easiest centering */
  place-items: center;             /* both axes */
  padding: 16px;
  overflow: auto;                  /* allow scroll on tiny screens/keyboard */
}

/* Remove vertical offsets that push it off-center */
.auth-card{
  margin: 0;                       /* kill margin-top */
  width: 100%;
  max-width: 480px;
  padding: 22px;
}


.auth-head {
    text-align: center;
    margin-bottom: 12px
}

.auth-head h1 {
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 800;
    letter-spacing: -.01em
}

.auth-head p {
    color: var(--muted);
    font-size: .95rem;
    margin-top: 4px
}

.btn {
    appearance: none;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 600;
    cursor: pointer;
    transition: .2s;
    border: 1px solid var(--border);
    background: #fff;
    width: 100%
}

.btn:hover {
    box-shadow: var(--shadow)
}

.btn-primary {
    background: #111827;
    color: #fff;
    border-color: #111827;
    padding: 10px;
    border-radius: 10px;
    font-size: 20px;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(17, 24, 39, .18)
}

.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 700
}

.btn-google svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px
}

.divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: .9rem;
    margin: 14px 0
}

.divider::before,
.divider::after {
    content: "";
    height: 1px;
    background: var(--border)
}

.form {
    display: grid;
    gap: 12px
}

.field {
    display: grid;
    gap: 6px
}

.label {
    font-weight: 600;
    font-size: .95rem
}

.input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    font-size: 1rem;
    background: #fff;
    outline: none
}

.input:focus {
    border-color: #111827;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, .08)
}

.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    /* flex-wrap: wrap */
}

.muted {
    color: var(--muted);
    font-size: .92rem
}

.link {
    color: var(--muted-2);
    font-weight: 600;
    text-decoration: none;
    text-align: center;
}

.foot-note {
    display: block;
    width: 100%;
    text-align: center;
    color: var(--muted);
    font-size: .9rem;
    margin-top: 12px;
}


.hint {
    color: var(--muted);
    font-size: .85rem
}

footer {
    padding: 18px 20px;
    color: var(--muted)
}

.foot {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap
}

@media (max-width:480px) {
    .auth-card {
        padding: 18px
    }
}


@media (max-height:701px) {
   .auth{
    align-items: flex-start;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: clamp(8px, env(safe-area-inset-top, 0px), 16px); /* NOT env + 24px */
  }

}


/* --- Spinner (drop this in your CSS) --- */



.spinner {
    width: var(--spin-size);
    height: var(--spin-size);
    display: inline-block;
    border-radius: 50%;
    border: var(--spin-thickness) solid var(--spin-track);
    border-top-color: var(--spin-color);
    animation: spin var(--spin-speed) linear infinite;
}

/* Visually-hidden text for screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

/* Optional variants */
.spinner.sm {
    --spin-size: 24px;
    --spin-thickness: 2px;
}

.spinner.lg {
    --spin-size: 64px;
    --spin-thickness: 4px;
}

.spinner.fast {
    --spin-speed: 600ms;
}

.spinner.slow {
    --spin-speed: 1400ms;
}

.logo {

    height: 100px;
    width: 100px;
}

.logo-wrap {
    display: flex;
    justify-content: center;
    /* horizontal */
    align-items: center;
    /* vertical */
    /* optional sizing for the area you want to center in: */
    min-height: 120px;
    /* or 100vh to center on the page */
}

.latex-logo {
    color: #ff6b35;
    font-size: 45px;
}

/* landscape fix */
/* Keep it simple: pin content to top in landscape so it can't vanish off-screen */
/* Landscape on short screens: top-align, tiny safe inset, nuke extra margins */
@media (orientation: landscape) and (max-height: 603px){
  .auth{
    align-items: flex-start;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: clamp(8px, env(safe-area-inset-top, 0px), 16px); /* NOT env + 24px */
  }
  .auth-card{ margin-top: 0 !important; }
  .latex-logo{ margin-top: 0 !important; } /* overrides your 60px rule */
}

