/* ============================================
   WonderHug Auth Pages – Shared Styles
   Uses premium.css design-system tokens
   ============================================ */

/* ---- Auth page body / main ---- */
.wh-auth-body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f0fa 0%, #eef8f7 100%);
}

.wh-auth-body::before {
    display: none !important;
}

.wh-auth-main {
    width: 100%;
    min-height: 100vh;
    padding: var(--sp-4);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- Single-column centered card (login, forgot, reset) ---- */
.wh-auth-wrap {
    width: 100%;
    max-width: 480px;
}

.wh-auth-card {
    background: var(--wh-white);
    border-radius: var(--r-xl);
    border: 1px solid rgba(127, 62, 155, 0.10);
    box-shadow: 0 14px 38px rgba(31, 41, 55, 0.12);
    overflow: hidden;
}

.wh-auth-card .wh-card-body {
    padding: var(--sp-10) var(--sp-8);
}

.wh-auth-card:hover {
    transform: none;
    box-shadow: 0 14px 38px rgba(31, 41, 55, 0.12);
}

/* ---- Auth header (icon + heading + sub) ---- */
.wh-auth-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--r-lg);
    background: var(--wh-primary-lighter);
    color: var(--wh-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin: 0 auto var(--sp-5);
}

.wh-auth-title {
    margin: 0 0 var(--sp-1);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--wh-gray-900);
    text-align: center;
}

.wh-auth-subtitle {
    margin: 0 0 var(--sp-6);
    font-size: 0.92rem;
    color: var(--wh-gray-500);
    text-align: center;
}

/* ---- Form helpers ---- */
.wh-auth-card .wh-form-group {
    margin-bottom: var(--sp-4);
}

.wh-auth-card .wh-form-input {
    min-height: 44px;
}

.wh-auth-card .wh-form-input:focus {
    border-color: var(--wh-primary);
    box-shadow: 0 0 0 4px rgba(127, 62, 155, 0.08);
}

.wh-field-error {
    color: #dc3545;
    display: block;
    margin-top: 6px;
    font-size: 0.82rem;
}

.wh-auth-submit {
    width: 100%;
    margin-top: var(--sp-4);
}

/* ---- Alert variants ---- */
.wh-auth-alert {
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--r-md);
    margin-bottom: var(--sp-5);
    border-left: 4px solid;
    font-size: 0.875rem;
    line-height: 1.5;
}

.wh-auth-alert--error {
    background-color: #fef2f2;
    color: #991b1b;
    border-left-color: #dc3545;
}

.wh-auth-alert--success {
    background-color: #f0fdf4;
    color: #166534;
    border-left-color: #22c55e;
}

/* ---- Footer links ---- */
.wh-auth-footer {
    text-align: center;
    margin-top: var(--sp-5);
    font-size: 0.875rem;
    color: var(--wh-gray-500);
}

.wh-auth-footer a {
    color: var(--wh-primary);
    text-decoration: none;
    font-weight: 600;
}

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

.wh-auth-divider {
    border-top: 1px solid var(--wh-gray-200);
    margin-top: var(--sp-5);
    padding-top: var(--sp-5);
}

.wh-auth-back {
    text-align: center;
    margin-top: var(--sp-4);
}

.wh-auth-back a {
    color: var(--wh-gray-500);
    text-decoration: none;
    font-size: 0.875rem;
}

.wh-auth-back a:hover {
    color: var(--wh-primary);
}

/* ---- Two-column layout (register) ---- */
.wh-auth-wrap--wide {
    max-width: 1180px;
    width: 80%;
}

.wh-auth-split {
    display: grid;
    grid-template-columns: 38% 62%;
    min-height: calc(100vh - 32px);
}

.wh-auth-split .wh-auth-card {
    border-radius: var(--r-xl);
}

/* ---- Info side panel ---- */
.wh-auth-side {
    background: linear-gradient(160deg, var(--wh-primary) 0%, #6a49b5 55%, var(--wh-secondary) 100%);
    color: #fff;
    padding: var(--sp-8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: var(--r-xl) 0 0 var(--r-xl);
}

.wh-auth-side h3 {
    font-size: 1.95rem;
    font-weight: 700;
    margin-bottom: var(--sp-2);
    line-height: 1.2;
}

.wh-auth-side p {
    opacity: 0.94;
    margin-bottom: var(--sp-5);
    line-height: 1.55;
}

.wh-auth-benefits {
    margin: 0;
    padding: 0;
    list-style: none;
}

.wh-auth-benefits li {
    margin-bottom: var(--sp-3);
    font-size: 0.92rem;
    line-height: 1.4;
    position: relative;
    padding-left: 1.35rem;
}

.wh-auth-benefits li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 700;
}

/* ---- Form side panel ---- */
.wh-auth-form-panel {
    padding: var(--sp-6) var(--sp-8);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.wh-auth-form-title {
    font-size: 1.45rem;
    font-weight: 700;
    margin: 0 0 var(--sp-1);
    color: var(--wh-gray-800);
}

.wh-auth-form-sub {
    font-size: 0.88rem;
    color: var(--wh-gray-500);
    margin: 0 0 var(--sp-4);
}

/* ---- Fields grid (two columns for register) ---- */
.wh-auth-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 14px;
}

.wh-auth-fields-grid .wh-form-group {
    margin-bottom: 0;
}

.wh-auth-fields-grid .wh-form-input {
    min-height: 40px;
    padding-top: var(--sp-2);
    padding-bottom: var(--sp-2);
}

.wh-auth-span-full {
    grid-column: 1 / -1;
}

/* ---- Password grid (reset page) ---- */
.wh-auth-password-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ---- Checkbox row ---- */
.wh-auth-check {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-2);
}

.wh-auth-check input[type="checkbox"] {
    margin-top: 4px;
    accent-color: var(--wh-primary);
}

.wh-auth-check label {
    font-size: 0.8125rem;
    color: var(--wh-gray-600);
}

.wh-auth-check a {
    color: var(--wh-primary);
    text-decoration: none;
    font-weight: 600;
}

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

/* ---- Remember me / forgot row ---- */
.wh-auth-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--sp-4);
}

.wh-auth-row a {
    font-size: 0.8125rem;
    color: var(--wh-primary);
    text-decoration: none;
    font-weight: 600;
}

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

/* ============ Responsive ============ */
@media (max-width: 900px) {
    .wh-auth-wrap--wide {
        width: 96%;
    }
}

@media (max-width: 768px) {
    .wh-auth-split {
        grid-template-columns: 1fr;
    }

    .wh-auth-side {
        padding: var(--sp-6);
        border-radius: var(--r-xl) var(--r-xl) 0 0;
    }

    .wh-auth-form-panel {
        padding: var(--sp-5);
    }

    .wh-auth-fields-grid {
        grid-template-columns: 1fr;
    }

    .wh-auth-password-grid {
        grid-template-columns: 1fr;
    }

    .wh-auth-card .wh-card-body {
        padding: var(--sp-6) var(--sp-5);
    }
}

@media (max-width: 480px) {
    .wh-auth-main {
        padding: var(--sp-2);
    }

    .wh-auth-card .wh-card-body {
        padding: var(--sp-5) var(--sp-4);
    }

    .wh-auth-form-panel {
        padding: var(--sp-4);
    }
}