/* =========================================================
   AGRISENSE AUTH UI CLEAN RESET
========================================================= */

.auth-body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(34, 197, 94, 0.16), transparent 34rem),
        linear-gradient(135deg, var(--bg), var(--bg2, var(--bg)));
    color: var(--text);
    overflow-x: hidden;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-topbar {
    min-height: 96px;
    padding: 22px clamp(18px, 5vw, 64px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(18px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--text);
}

.auth-brand img,
.auth-card-logo img,
.footer-brand-line img {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.14);
}

.auth-brand strong {
    display: block;
    font-size: 22px;
    line-height: 1;
    letter-spacing: -0.04em;
}

.auth-brand small {
    display: block;
    margin-top: 7px;
    color: var(--green);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.auth-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.auth-nav a {
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
}

.auth-nav a:hover {
    color: var(--green);
}

.auth-theme-btn {
    width: 54px;
    height: 54px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    display: grid;
    place-items: center;
    box-shadow: var(--shadow, 0 18px 40px rgba(0,0,0,.12));
}

.auth-theme-btn .moon {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    display: block;
    background: currentColor;
}

.auth-main {
    flex: 1;
    width: 100%;
    padding: clamp(36px, 7vw, 92px) clamp(18px, 5vw, 64px);
    display: grid;
    place-items: center;
}

.auth-shell {
    width: min(1120px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, 460px);
    align-items: center;
    gap: clamp(28px, 6vw, 80px);
}

.auth-copy {
    max-width: 620px;
}

.auth-copy .eyebrow {
    margin: 0 0 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.28em;
    font-size: 12px;
    font-weight: 900;
}

.auth-copy h1 {
    margin: 0;
    font-size: clamp(42px, 7vw, 86px);
    line-height: 0.92;
    letter-spacing: -0.08em;
}

.auth-copy p {
    margin: 24px 0 0;
    max-width: 560px;
    color: var(--muted);
    font-size: 19px;
    line-height: 1.7;
}

.auth-points {
    margin-top: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.auth-points span {
    padding: 12px 16px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
    font-weight: 800;
}

.auth-card-wrap {
    width: 100%;
}

.auth-card {
    width: 100%;
    padding: 34px;
    border-radius: 34px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow, 0 30px 80px rgba(0,0,0,.18));
}

.auth-card-logo {
    margin-bottom: 24px;
}

.auth-card h2 {
    margin: 0 0 8px;
    font-size: 34px;
    letter-spacing: -0.05em;
}

.auth-muted {
    margin: 0 0 26px;
    color: var(--muted);
    line-height: 1.6;
}

.auth-card label {
    display: block;
    margin: 18px 0 8px;
    color: var(--muted);
    font-weight: 900;
    font-size: 13px;
}

.auth-card input {
    width: 100%;
    min-height: 56px;
    padding: 0 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    outline: none;
    font-weight: 700;
}

.auth-card input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 4px var(--green-soft);
}

.password-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
    width: 100%;
}

.password-row button {
    flex: 0 0 auto;
    min-width: 82px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface2, var(--surface));
    color: var(--text);
    font-weight: 900;
    cursor: pointer;
}

.password-row input {
    flex: 1 1 auto;
    min-width: 0;
}

.auth-submit {
    width: 100%;
    min-height: 58px;
    margin-top: 26px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--green), #16a34a);
    color: #03140b;
    font-weight: 950;
    cursor: pointer;
    box-shadow: 0 18px 40px rgba(34, 197, 94, 0.26);
}

.auth-links {
    margin-top: 22px;
    display: grid;
    gap: 10px;
}

.auth-links a {
    color: var(--green);
    text-decoration: none;
    font-weight: 900;
}

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

.flash-stack {
    margin-bottom: 16px;
    display: grid;
    gap: 10px;
}

.flash-message {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-weight: 800;
}

.password-meter {
    margin-top: 10px;
    height: 8px;
    border-radius: 999px;
    background: var(--bg);
    overflow: hidden;
}

.password-meter span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--green);
    transition: width .2s ease;
}

.password-strength-bar.weak {
    width: 25%;
    background: #ef4444;
}

.password-strength-bar.medium {
    width: 60%;
    background: #f59e0b;
}

.password-strength-bar.strong {
    width: 100%;
    background: var(--green);
}

.auth-help {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.match-ok {
    color: var(--green) !important;
}

.match-bad {
    color: #ef4444 !important;
}

.auth-footer {
    margin: 0;
    padding: clamp(28px, 5vw, 54px) clamp(18px, 5vw, 64px);
    display: grid;
    grid-template-columns: minmax(280px, 1.4fr) repeat(3, minmax(150px, 1fr));
    gap: 30px;
    border-top: 1px solid var(--border);
    background:
        radial-gradient(circle at top left, rgba(34, 197, 94, 0.22), transparent 32rem),
        var(--surface);
}

.footer-brand-line {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.auth-footer p,
.auth-footer a,
.auth-footer span {
    display: block;
    color: var(--muted);
    text-decoration: none;
    line-height: 1.8;
    font-weight: 700;
}

.auth-footer h4 {
    margin: 0 0 14px;
    color: var(--amber, #f59e0b);
    text-transform: uppercase;
    letter-spacing: .22em;
    font-size: 12px;
}

@media (max-width: 900px) {
    .auth-topbar {
        min-height: 72px;
        padding: 14px 16px;
    }

    .auth-brand img {
        width: 42px;
        height: 42px;
    }

    .auth-brand strong {
        font-size: 18px;
    }

    .auth-brand small {
        font-size: 9px;
    }

    .auth-nav {
        gap: 10px;
    }

    .auth-nav a {
        display: none;
    }

    .auth-theme-btn {
        width: 46px;
        height: 46px;
        border-radius: 16px;
    }

    .auth-main {
        padding: 28px 16px 42px;
        place-items: start center;
    }

    .auth-shell {
        grid-template-columns: 1fr;
        gap: 24px;
    }

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

    .auth-copy h1 {
        font-size: 42px;
    }

    .auth-copy p {
        font-size: 16px;
        margin-top: 14px;
    }

    .auth-points {
        display: none;
    }

    .auth-card {
        padding: 24px;
        border-radius: 28px;
    }

    .auth-card h2 {
        font-size: 30px;
    }

    .password-row button {
        min-height: 46px;
    }

    .auth-footer {
        grid-template-columns: 1fr;
        border-radius: 32px 32px 0 0;
        margin-top: 10px;
    }
}

/* =========================================================
   FINAL AUTH PAGE CUTOFF FIX
   Login/signup must not behave like landing page.
   This makes auth pages scrollable, centered, and responsive.
========================================================= */

body.auth-body {
    min-height: 100vh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

.auth-page {
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-x: hidden !important;
}

/* Compact header */
.auth-topbar {
    position: relative !important;
    top: auto !important;
    min-height: 86px !important;
    padding: 18px clamp(18px, 5vw, 56px) !important;
    flex-shrink: 0 !important;
}

/* Main must never cut content */
.auth-main {
    flex: 1 0 auto !important;
    width: 100% !important;
    min-height: auto !important;
    padding: clamp(32px, 6vw, 70px) 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: visible !important;
}

/* Remove giant landing-style split on login/signup */
.auth-shell {
    width: min(560px, 100%) !important;
    max-width: 560px !important;
    display: block !important;
    margin: 0 auto !important;
}

/* Hide left marketing panel on auth pages */
.auth-copy {
    display: none !important;
}

/* Form card should sit cleanly in center */
.auth-card-wrap {
    width: 100% !important;
    max-width: 560px !important;
    margin: 0 auto !important;
}

.auth-card {
    width: 100% !important;
    max-width: 560px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
}

/* Footer should appear after form, not cover it */
.auth-footer {
    flex-shrink: 0 !important;
    margin-top: auto !important;
}

/* Fix oversized auth inputs */
.auth-card input,
.password-row input {
    box-sizing: border-box !important;
    max-width: 100% !important;
}

.password-row {
    width: 100% !important;
    display: flex !important;
    align-items: stretch !important;
    grid-template-columns: none !important;
}

/* Tablet/mobile */
@media (max-width: 900px) {
    .auth-topbar {
        min-height: 72px !important;
        padding: 12px 14px !important;
    }

    .auth-brand span {
        display: block !important;
    }

    .auth-brand strong {
        font-size: 17px !important;
    }

    .auth-brand small {
        font-size: 9px !important;
    }

    .auth-main {
        padding: 24px 14px 36px !important;
        align-items: flex-start !important;
    }

    .auth-shell,
    .auth-card-wrap,
    .auth-card {
        width: 100% !important;
        max-width: 100% !important;
    }

    .auth-card {
        padding: 22px !important;
        border-radius: 28px !important;
    }

    .auth-card h2 {
        font-size: 34px !important;
        line-height: 1 !important;
    }

    .auth-card-logo img {
        width: 52px !important;
        height: 52px !important;
    }

    .auth-nav {
        gap: 8px !important;
    }

    .auth-nav a {
        display: none !important;
    }

    .auth-theme-btn {
        width: 48px !important;
        height: 48px !important;
    }

    .auth-footer {
        margin-top: 20px !important;
        padding: 28px 18px !important;
        grid-template-columns: 1fr !important;
        border-radius: 28px 28px 0 0 !important;
    }
}

/* Very small phones */
@media (max-width: 430px) {
    .auth-main {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .auth-card {
        padding: 20px !important;
        border-radius: 24px !important;
    }

    .auth-card h2 {
        font-size: 30px !important;
    }

    .auth-card input {
        min-height: 52px !important;
    }

    .auth-submit {
        min-height: 54px !important;
    }
}

