/* HETRIIL Auth Pages — MoE Branding & Responsive */
:root {
    --het-yellow: #f7be18;
    --het-red: #d1503e;
    --het-sky: #3c8fc2;
    --het-blue: #2050a0;
    --het-blue-dark: #163a75;
    --het-gray-50: #f8fafc;
    --het-gray-100: #f1f5f9;
    --het-gray-500: #64748b;
    --het-gray-700: #334155;
    --het-gray-900: #0f172a;
    --het-radius: 0.875rem;
    --het-radius-lg: 1.25rem;
    --het-shadow: 0 4px 24px rgba(32, 80, 160, 0.1);
    --het-header-h: 4.25rem;
}

html {
    overflow-x: clip;
    scroll-behavior: smooth;
}

.het-auth-body {
    margin: 0;
    min-height: 100dvh;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(160deg, var(--het-gray-50) 0%, #fff 45%, rgba(32, 80, 160, 0.06) 100%);
    color: var(--het-gray-900);
    overflow-x: hidden;
}

.het-auth-body.het-menu-open,
.het-auth-body.het-nav-open {
    overflow: hidden;
    touch-action: none;
}

[x-cloak] { display: none !important; }

/* Header */
.het-auth-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid rgba(32, 80, 160, 0.08);
    backdrop-filter: blur(10px);
}

.het-auth-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.625rem 1rem;
    min-height: var(--het-header-h);
}

.het-auth-brand-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.het-auth-brand-logo {
    width: 2.75rem;
    height: 2.75rem;
    flex-shrink: 0;
    border-radius: 9999px;
    background: #fff;
    box-shadow: var(--het-shadow);
}

.het-auth-brand-text {
    min-width: 0;
}

.het-auth-brand-text .eyebrow {
    display: block;
    font-size: 0.625rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--het-gray-500);
    line-height: 1.2;
}

.het-auth-brand-text .title {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--het-gray-700);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.het-auth-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem;
    border: none;
    border-radius: 0.625rem;
    background: transparent;
    color: var(--het-gray-700);
    cursor: pointer;
    flex-shrink: 0;
    margin-left: auto;
}

.het-auth-menu-btn:hover {
    background: rgba(32, 80, 160, 0.06);
    color: var(--het-blue);
}

.het-flag-stripe {
    display: flex;
    width: 100%;
    height: 0.375rem;
}
.het-flag-stripe > span:nth-child(1) { width: 25%; background: var(--het-yellow); }
.het-flag-stripe > span:nth-child(2) { width: 33.33%; background: var(--het-red); }
.het-flag-stripe > span:nth-child(3) { width: 16.67%; background: var(--het-sky); }
.het-flag-stripe > span:nth-child(4) { width: 25%; background: var(--het-blue); }

/* Off-canvas menu (right) */
.het-auth-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(15, 23, 42, 0.45);
}

.het-auth-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 51;
    width: min(100%, 20rem);
    height: 100dvh;
    background: #fff;
    box-shadow: -8px 0 32px rgba(32, 80, 160, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.het-auth-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--het-gray-100);
    font-weight: 600;
    color: var(--het-blue);
}

.het-auth-drawer-close {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 0.5rem;
    cursor: pointer;
    color: var(--het-gray-700);
}

.het-auth-drawer-nav {
    list-style: none;
    margin: 0;
    padding: 0.75rem;
    overflow-y: auto;
    flex: 1;
}

.het-auth-drawer-nav a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0.625rem 1rem;
    border-radius: 0.625rem;
    color: var(--het-gray-700);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
}

.het-auth-drawer-nav a:hover,
.het-auth-drawer-nav a:focus-visible {
    background: rgba(32, 80, 160, 0.06);
    color: var(--het-blue);
}

/* Page shell */
.het-auth-main {
    padding: calc(var(--het-header-total, 3.2rem) + 0.5rem) 1rem 2rem;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.het-auth-card {
    width: 100%;
    max-width: 68rem;
    background: #fff;
    border-radius: var(--het-radius-lg);
    box-shadow: var(--het-shadow);
    border: 1px solid rgba(32, 80, 160, 0.08);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr;
}

.het-auth-card--register {
    max-width: 32rem;
}

.het-auth-brand-panel {
    padding: 2rem 1.5rem;
    text-align: center;
    background: linear-gradient(145deg, var(--het-blue-dark) 0%, var(--het-blue) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.het-auth-brand-panel img {
    max-width: 7rem;
    width: 100%;
    height: auto;
}

.het-auth-brand-panel h1 {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.het-auth-brand-panel p {
    margin: 0;
    font-size: clamp(0.875rem, 2.5vw, 0.9375rem);
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.88);
    max-width: 22rem;
}

.het-auth-form-panel {
    padding: 1.5rem 1.25rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.het-auth-form-inner {
    width: 100%;
    max-width: 24rem;
}

.het-auth-form-inner--wide {
    max-width: 100%;
}

.het-auth-heading {
    text-align: center;
    margin-bottom: 1.5rem;
}

.het-auth-heading h2 {
    margin: 0 0 0.375rem;
    font-size: clamp(1.375rem, 4vw, 1.625rem);
    font-weight: 700;
    color: var(--het-gray-900);
}

.het-auth-heading p {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--het-gray-500);
}

/* Form controls */
.het-auth-form .form-group {
    margin-bottom: 1rem;
}

.het-auth-form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--het-gray-700);
    margin-bottom: 0.375rem;
}

.het-auth-form .form-control {
    width: 100%;
    min-height: 44px;
    padding: 0.625rem 0.875rem;
    font-size: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.625rem;
    background: #fff;
    color: var(--het-gray-900);
    box-sizing: border-box;
}

.het-auth-form .form-control:focus {
    outline: none;
    border-color: var(--het-blue);
    box-shadow: 0 0 0 3px rgba(32, 80, 160, 0.15);
}

.het-auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 0.625rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
    width: 100%;
    box-sizing: border-box;
}

.het-auth-btn-primary {
    background: var(--het-blue);
    color: #fff;
}

.het-auth-btn-primary:hover {
    background: var(--het-blue-dark);
    color: #fff;
}

.het-auth-btn-outline {
    background: transparent;
    color: var(--het-blue);
    border: 2px solid var(--het-blue);
}

.het-auth-btn-outline:hover {
    background: rgba(32, 80, 160, 0.06);
    color: var(--het-blue-dark);
}

.het-auth-btn-light {
    background: #fff;
    color: var(--het-gray-900);
    border: 1px solid #e5e7eb;
}

.het-auth-btn-light:hover {
    background: var(--het-gray-50);
}

.het-auth-divider {
    text-align: center;
    color: var(--het-gray-500);
    font-size: 0.8125rem;
    margin: 1.25rem 0;
}

.het-auth-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.het-auth-actions-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
}

.het-auth-link {
    color: var(--het-blue);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
}

.het-auth-link:hover {
    text-decoration: underline;
    color: var(--het-blue-dark);
}

.het-auth-alert {
    padding: 0.875rem 1rem;
    border-radius: 0.625rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.het-auth-alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.het-auth-alert ul {
    margin: 0;
    padding-left: 1.125rem;
}

.het-auth-google img {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

/* Tablet+ two-column login */
@media (min-width: 768px) {
    .het-auth-main {
        padding: calc(var(--het-header-h) + 1rem) 1.5rem 2.5rem;
    }

    .het-auth-card:not(.het-auth-card--register) {
        grid-template-columns: 1fr 1fr;
        min-height: 32rem;
    }

    .het-auth-brand-panel {
        padding: 2.5rem 2rem;
        text-align: left;
        align-items: flex-start;
    }

    .het-auth-form-panel {
        padding: 2.5rem 2rem;
    }

    .het-auth-actions-row--split {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .het-auth-actions-row--split .het-auth-btn-primary {
        width: auto;
        min-width: 8rem;
    }

    .het-auth-brand-text .title {
        white-space: normal;
    }
}

@media (min-width: 640px) {
    .het-auth-brand-logo {
        width: 3.25rem;
        height: 3.25rem;
    }
}

@media (min-width: 1024px) {
    .het-auth-header-inner {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .het-auth-form-panel {
        padding: 3rem;
    }
}

.het-auth-actions-row--split .het-auth-link {
    text-align: left;
}

@media (max-width: 767px) {
    .het-auth-actions-row--split .het-auth-btn-primary {
        width: 100%;
    }

    .het-auth-actions-row--split .het-auth-link {
        text-align: center;
    }
}
