/* HAVN Auth pages + modal */
.havn-auth-page {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    background:
        linear-gradient(135deg, rgba(34, 58, 39, 0.94), rgba(34, 58, 39, 0.82)),
        url('../images/hero-bg.jpg') center/cover no-repeat;
    background-color: #223A27;
}

.havn-auth-panel {
    width: 100%;
    max-width: 980px;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.havn-auth-brand {
    background: #223A27;
    color: #fff;
    padding: 56px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.havn-auth-brand img {
    width: 140px;
    margin-bottom: 28px;
    filter: brightness(0) invert(1);
}

.havn-auth-brand h1 {
    font-size: 36px;
    line-height: 1.2;
    margin-bottom: 14px;
    color: #fff;
}

.havn-auth-brand p {
    color: rgba(255, 255, 255, 0.78);
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
}

.havn-auth-form-wrap {
    padding: 56px 48px;
}

.havn-auth-form-wrap h2 {
    font-size: 28px;
    margin-bottom: 8px;
    color: #223A27;
}

.havn-auth-sub {
    color: #707070;
    margin-bottom: 28px;
}

.havn-auth-form .form-group {
    margin-bottom: 18px;
}

.havn-auth-form label {
    display: block;
    margin-bottom: 8px;
    color: #223A27;
    font-weight: 600;
    font-size: 14px;
}

.havn-auth-form input[type="text"],
.havn-auth-form input[type="email"],
.havn-auth-form input[type="password"],
.havn-auth-form input[type="tel"],
.havn-auth-modal input[type="text"],
.havn-auth-modal input[type="email"],
.havn-auth-modal input[type="password"],
.havn-auth-modal input[type="tel"] {
    width: 100%;
    height: 50px;
    border: 1px solid rgba(34, 58, 39, 0.18);
    padding: 0 16px;
    background: #f7f8f7;
    color: #000;
    outline: none;
}

.havn-auth-form input:focus,
.havn-auth-modal input:focus {
    border-color: #223A27;
    background: #fff;
}

.havn-auth-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    gap: 12px;
}

.havn-auth-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #707070;
    font-size: 14px;
    margin-bottom: 16px;
}

.havn-auth-row a,
.havn-auth-switch a {
    color: #223A27;
    font-weight: 600;
}

.havn-auth-btn {
    width: 100%;
    height: 52px;
    border: 0;
    background: #223A27;
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: 0.2s ease;
}

.havn-auth-btn:hover {
    background: #18291c;
}

.havn-auth-btn-outline {
    background: #fff;
    color: #223A27;
    border: 1px solid #223A27;
}

.havn-auth-btn-outline:hover {
    background: #223A27;
    color: #fff;
}

.havn-auth-switch {
    margin-top: 22px;
    text-align: center;
    color: #707070;
}

.havn-auth-alert {
    background: #fdeceb;
    color: #8a1f1a;
    padding: 12px 14px;
    margin-bottom: 18px;
    font-size: 14px;
}

.havn-auth-alert ul {
    margin: 0;
    padding-left: 18px;
}

.havn-auth-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.havn-auth-modal.is-open {
    display: flex;
}

body.havn-auth-open {
    overflow: hidden;
}

.havn-auth-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(18, 28, 20, 0.72);
    backdrop-filter: blur(4px);
}

.havn-auth-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: #fff;
    padding: 40px 36px 32px;
    z-index: 1;
    max-height: 92vh;
    overflow: auto;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(34, 58, 39, 0.08);
}

.havn-auth-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #f3f5f3;
    font-size: 22px;
    line-height: 1;
    color: #223A27;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s ease;
}

.havn-auth-modal-close:hover {
    background: #223A27;
    color: #fff;
}

.havn-auth-modal-brand {
    text-align: center;
    margin-bottom: 28px;
}

.havn-auth-modal-brand img {
    width: 88px;
    margin-bottom: 16px;
}

.havn-auth-modal-brand h2 {
    margin: 0 0 8px;
    color: #223A27;
    font-size: 26px;
    line-height: 1.2;
}

.havn-auth-modal-brand p {
    margin: 0;
    color: #707070;
    font-size: 14px;
    line-height: 1.5;
}

.havn-auth-tab-panel {
    display: none;
}

.havn-auth-tab-panel.active {
    display: block;
}

.havn-modal-form .havn-field {
    margin-bottom: 16px;
}

.havn-modal-form label {
    display: block;
    margin-bottom: 8px;
    color: #223A27;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.havn-field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.havn-field-row label {
    margin-bottom: 0;
}

.havn-field-link {
    color: #223A27;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.havn-field-link:hover {
    text-decoration: underline;
}

.havn-modal-form input[type="text"],
.havn-modal-form input[type="email"],
.havn-modal-form input[type="password"] {
    width: 100%;
    height: 50px;
    border: 1px solid rgba(34, 58, 39, 0.16);
    background: #fff;
    color: #111;
    padding: 0 16px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: none;
    -webkit-appearance: none;
}

.havn-modal-form input:hover {
    border-color: rgba(34, 58, 39, 0.35);
}

.havn-modal-form input:focus {
    border-color: #223A27;
    box-shadow: 0 0 0 3px rgba(34, 58, 39, 0.12);
    background: #fff;
}

.havn-modal-form input:-webkit-autofill,
.havn-modal-form input:-webkit-autofill:hover,
.havn-modal-form input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 40px #fff inset !important;
    -webkit-text-fill-color: #111 !important;
    caret-color: #111;
    border-color: rgba(34, 58, 39, 0.16);
}

.havn-field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.havn-auth-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 18px;
    color: #707070;
    font-size: 13px;
    cursor: pointer;
}

.havn-auth-check input {
    width: 16px;
    height: 16px;
    accent-color: #223A27;
}

.havn-auth-modal .havn-auth-btn {
    width: 100%;
    height: 52px;
    border: 0;
    background: #223A27;
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: 0.2s ease;
}

.havn-auth-modal .havn-auth-btn:hover {
    background: #18291c;
}

.havn-auth-modal .havn-auth-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.havn-auth-modal-error {
    background: #fdeceb;
    color: #8a1f1a;
    padding: 10px 12px;
    margin-bottom: 14px;
    font-size: 13px;
}

.havn-auth-or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 14px;
    color: #8a8a8a;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.havn-auth-or::before,
.havn-auth-or::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(34, 58, 39, 0.12);
}

.havn-auth-guest-btn {
    width: 100%;
    border: 1px solid #223A27;
    background: #fff;
    color: #223A27;
    font-size: 15px;
    font-weight: 700;
    padding: 12px 16px;
    cursor: pointer;
}

.havn-auth-guest-btn:hover {
    background: #223A27;
    color: #fff;
}

.havn-guest-hint {
    color: #707070;
    font-size: 13px;
    line-height: 1.5;
    margin: -4px 0 16px;
}

.havn-auth-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(34, 58, 39, 0.1);
    text-align: center;
}

.havn-auth-footer p {
    margin: 0 0 8px;
    color: #707070;
    font-size: 14px;
}

.havn-auth-link-btn {
    border: 0;
    background: transparent;
    color: #223A27;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    padding: 0;
}

.havn-auth-link-btn:hover {
    color: #18291c;
}

.havn-header-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 4px;
    border-radius: 999px;
    background: #223A27;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

@media (max-width: 991px) {
    .havn-auth-panel {
        grid-template-columns: 1fr;
        max-width: 480px;
    }

    .havn-auth-brand {
        padding: 36px 28px;
    }

    .havn-auth-form-wrap {
        padding: 36px 28px;
    }

    .havn-auth-modal-dialog {
        padding: 32px 22px 24px;
    }

    .havn-field-grid {
        grid-template-columns: 1fr;
    }
}

/* Native scroll on product detail — avoids SmoothScroll lag */
html:has(body.is-product-page) {
    scroll-behavior: auto !important;
}

body.is-product-page .cb-cursor {
    display: none !important;
}
