:root {
    --home-auth-overlay: rgba(15, 23, 42, 0.52);
    --home-auth-surface: rgba(255, 255, 255, 0.98);
    --home-auth-border: rgba(148, 163, 184, 0.2);
    --home-auth-text: #18212f;
    --home-auth-muted: #64748b;
    --home-auth-accent: #0f766e;
    --home-auth-accent-soft: rgba(15, 118, 110, 0.12);
}

body.home-auth-modal-open {
    overflow: hidden;
}

.home-auth-modal {
    position: fixed;
    inset: 0;
    z-index: 2200;
    display: none;
}

.home-auth-modal.is-open {
    display: block;
}

.home-auth-backdrop {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, var(--home-auth-overlay), rgba(15, 23, 42, 0.72));
    backdrop-filter: blur(8px);
}

.home-auth-dialog {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(780px, calc(100vw - 20px));
    min-width: 560px;
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    display: flex;
    flex-direction: column;
    transform: translate(-50%, -50%);
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid var(--home-auth-border);
    background: var(--home-auth-surface);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}

.home-auth-dialog.is-positioned {
    transform: none;
}

.home-auth-dialog.is-dragging,
.home-auth-dialog.is-resizing {
    box-shadow: 0 34px 96px rgba(15, 23, 42, 0.34);
}

.home-auth-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 16px 8px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.94);
    cursor: move;
    user-select: none;
    touch-action: none;
}

.home-auth-kicker {
    display: none;
}

.home-auth-title {
    margin: 0;
    color: var(--home-auth-text);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

.home-auth-subtitle {
    display: none;
}

.home-auth-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.home-auth-switcher {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border-radius: 999px;
    background: rgba(248, 250, 252, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.home-auth-switch {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--home-auth-muted);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.home-auth-switch.is-active {
    background: #173047;
    color: #fff;
}

.home-auth-switch:hover,
.home-auth-close:hover {
    transform: translateY(-1px);
}

.home-auth-close {
    appearance: none;
    border: 1px solid rgba(148, 163, 184, 0.26);
    background: rgba(248, 250, 252, 0.96);
    color: var(--home-auth-text);
    width: 38px;
    height: 38px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.home-auth-frame-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0 14px 18px;
}

.home-auth-frame {
    width: 100%;
    max-width: none;
    min-height: 320px;
    height: 390px;
    display: block;
    border: none;
    border-radius: 0;
    background: transparent;
}

.home-auth-resize-handle {
    position: absolute;
    right: 10px;
    bottom: 8px;
    width: 18px;
    height: 18px;
    border-radius: 6px;
    cursor: nwse-resize;
    pointer-events: auto;
}

.home-auth-resize-handle::before,
.home-auth-resize-handle::after {
    content: "";
    position: absolute;
    border-right: 2px solid rgba(100, 116, 139, 0.75);
    border-bottom: 2px solid rgba(100, 116, 139, 0.75);
    border-bottom-right-radius: 3px;
}

.home-auth-resize-handle::before {
    inset: 4px;
}

.home-auth-resize-handle::after {
    inset: 8px 2px 2px 8px;
}

@media (max-width: 860px) {
    .home-auth-dialog {
        width: calc(100vw - 20px);
        min-width: 0;
        border-radius: 20px;
    }

    .home-auth-header {
        flex-direction: column;
        align-items: stretch;
        cursor: default;
        touch-action: auto;
    }

    .home-auth-controls {
        justify-content: space-between;
    }

    .home-auth-switcher {
        flex: 1;
    }

    .home-auth-switch {
        flex: 1;
        text-align: center;
    }

    .home-auth-resize-handle {
        display: none;
    }
}

@media (max-width: 560px) {
    .home-auth-header {
        padding: 14px 14px 10px;
    }

    .home-auth-title {
        font-size: 20px;
    }

    .home-auth-controls {
        gap: 10px;
    }

    .home-auth-frame-wrap {
        padding: 0 12px 12px;
    }

    .home-auth-frame {
        width: 100%;
        min-height: 420px;
    }
}
