:root {
    --hk-auth-ink: #251f1a;
    --hk-auth-muted: #685d52;
    --hk-auth-line: #dfd0c0;
    --hk-auth-paper: #fffaf3;
    --hk-auth-surface: #ffffff;
    --hk-auth-walnut: #6f4e37;
    --hk-auth-walnut-dark: #4e3425;
    --hk-auth-sage: #6d8067;
    --hk-auth-clay: #b86f50;
}

.hk-auth-page {
    min-height: 100vh;
    color: var(--hk-auth-ink);
    background-color: #efe3d2;
    background-image:
        linear-gradient(45deg, rgba(111, 78, 55, .055) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(111, 78, 55, .055) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(109, 128, 103, .05) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(109, 128, 103, .05) 75%),
        linear-gradient(180deg, #f7efe5 0%, #eadbc8 100%);
    background-position: 0 0, 0 14px, 14px -14px, -14px 0, 0 0;
    background-size: 28px 28px, 28px 28px, 28px 28px, 28px 28px, auto;
}

.hk-auth-shell {
    width: min(100% - 32px, 1080px);
    margin: 0 auto;
    padding: 48px 0;
}

.hk-auth-shell-narrow {
    width: min(100% - 32px, 470px);
}

.hk-auth-card {
    background: rgba(255, 250, 243, .98);
    border: 1px solid var(--hk-auth-line);
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(78, 52, 37, .14);
    overflow: hidden;
}

.hk-auth-head {
    padding: 28px 30px;
    border-bottom: 1px solid var(--hk-auth-line);
    background:
        linear-gradient(90deg, rgba(111, 78, 55, .08), rgba(109, 128, 103, .07)),
        var(--hk-auth-paper);
}

.hk-auth-mark {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: var(--hk-auth-walnut);
    color: #fff;
    font-weight: 800;
}

.hk-auth-title {
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: 0;
}

.hk-auth-copy {
    margin-top: 6px;
    color: var(--hk-auth-muted);
    font-size: 14px;
}

.hk-auth-body {
    padding: 30px;
}

.hk-type-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.hk-type-option {
    border: 1px solid var(--hk-auth-line);
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    background: #fff;
}

.hk-type-option.is-active {
    border-color: var(--hk-auth-walnut);
    box-shadow: 0 0 0 3px rgba(111, 78, 55, .14);
}

.hk-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.hk-field-full {
    grid-column: 1 / -1;
}

.hk-section-title {
    margin: 22px 0 12px;
    padding-top: 20px;
    border-top: 1px solid var(--hk-auth-line);
    font-weight: 900;
    font-size: 18px;
}

.hk-label {
    display: block;
    margin-bottom: 7px;
    color: var(--hk-auth-ink);
    font-weight: 800;
    font-size: 14px;
}

.hk-input {
    width: 100%;
    border: 1px solid #d6c6b7;
    border-radius: 8px;
    padding: 11px 12px;
    color: var(--hk-auth-ink);
    background: #fff;
}

.hk-input:focus {
    outline: none;
    border-color: var(--hk-auth-walnut);
    box-shadow: 0 0 0 3px rgba(111, 78, 55, .16);
}

.hk-checkbox {
    display: flex;
    gap: 10px;
    align-items: start;
    color: var(--hk-auth-ink);
    font-weight: 700;
}

.hk-checkbox input {
    margin-top: 3px;
    border-color: #c7b7a7;
    color: var(--hk-auth-walnut);
}

.hk-button {
    min-height: 46px;
    border-radius: 8px;
    background: var(--hk-auth-walnut);
    color: #fff;
    padding: 0 22px;
    font-weight: 900;
}

.hk-button:hover {
    background: var(--hk-auth-walnut-dark);
}

.hk-link {
    color: var(--hk-auth-walnut-dark);
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.hk-hidden {
    display: none !important;
}

.hk-auth-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 24px;
}

.hk-auth-status {
    margin-bottom: 18px;
    color: #315c35;
    font-weight: 700;
}

.hk-error-summary {
    margin-bottom: 22px;
    border: 1px solid rgba(184, 111, 80, .38);
    border-radius: 8px;
    background: #fff4ef;
    color: #7a351f;
    padding: 14px 16px;
    font-weight: 700;
}

.hk-error-summary ul {
    margin: 8px 0 0 18px;
    list-style: disc;
}

.hk-error-summary li + li {
    margin-top: 4px;
}

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

@media (max-width: 760px) {
    .hk-type-grid,
    .hk-form-grid {
        grid-template-columns: 1fr;
    }

    .hk-auth-shell {
        padding: 24px 0;
    }

    .hk-auth-head,
    .hk-auth-body {
        padding: 22px;
    }

    .hk-auth-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .hk-button {
        width: 100%;
    }
}

/* Modern auth refresh */
body {
    background:
        linear-gradient(135deg, rgba(255, 252, 247, .98), rgba(239, 221, 198, .94)),
        repeating-linear-gradient(45deg, rgba(111, 78, 55, .055) 0 1px, transparent 1px 20px);
}

.hk-auth-shell {
    position: relative;
}

.hk-auth-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(115deg, transparent 0 55%, rgba(122, 79, 53, .12) 55% 76%, transparent 76%),
        repeating-linear-gradient(90deg, transparent 0 86px, rgba(111, 78, 55, .032) 86px 87px);
}

.hk-auth-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(111, 78, 55, .18);
    border-radius: 8px;
    background: rgba(255, 252, 247, .94);
    box-shadow: 0 28px 80px rgba(67, 38, 22, .18);
    backdrop-filter: blur(14px);
}

.hk-auth-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: linear-gradient(90deg, #7a4f35, #b86f50, #d7a35c, #6f7d61);
}

.hk-auth-head {
    background:
        linear-gradient(118deg, rgba(255, 252, 247, .98), rgba(243, 229, 211, .84)),
        repeating-linear-gradient(135deg, rgba(111, 78, 55, .045) 0 1px, transparent 1px 18px);
}

.hk-logo-mark {
    box-shadow: 0 14px 28px rgba(78, 47, 30, .24);
}

.hk-type-option {
    border-radius: 8px;
    background: rgba(255, 255, 255, .78);
    box-shadow: 0 12px 30px rgba(80, 48, 28, .08);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.hk-type-option:hover,
.hk-type-option.is-active {
    transform: translateY(-3px);
    border-color: rgba(122, 79, 53, .46);
    box-shadow: 0 18px 44px rgba(80, 48, 28, .14);
}

.hk-form-section {
    border-color: rgba(111, 78, 55, .16);
}

.hk-input,
.hk-textarea,
.hk-file {
    border-radius: 8px;
    background: rgba(255, 255, 255, .82);
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.hk-input:focus,
.hk-textarea:focus,
.hk-file:focus-within {
    border-color: rgba(122, 79, 53, .55);
    box-shadow: 0 0 0 4px rgba(184, 111, 80, .14);
    outline: none;
}

.hk-button {
    border-radius: 8px;
    background: linear-gradient(135deg, #7a4f35 0%, #4f301f 100%);
    box-shadow: 0 16px 32px rgba(91, 55, 33, .22);
    transition: transform .18s ease, box-shadow .18s ease;
}

.hk-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 42px rgba(91, 55, 33, .25);
}

.hk-error-summary,
.hk-auth-status {
    border-radius: 8px;
    box-shadow: 0 12px 26px rgba(80, 48, 28, .07);
}
