/* Login page styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    min-height: 100vh;
    background: var(--bg-color, #1a1a1a);
    color: #e0e0e0;
    overflow-x: hidden;
    overflow-y: auto;
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px 20px 100px 20px;
    position: relative;
    z-index: 1;
}

.auth-wrapper {
    display: flex;
    gap: 40px;
    max-width: 1200px;
    width: 100%;
    align-items: flex-start;
    justify-content: center;
}

.auth-card {
    background: var(--card-bg-color, rgba(32, 32, 32, 0.95));
    border: 1px solid var(--border-color, #404040);
    border-radius: 8px;
    padding: 40px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
    flex-shrink: 0;
}

.video-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.video-container {
    position: relative;
    width: 100%;
    height: 720px;
    max-width: 1280px; /* 16:9 ratio for 720p height */
    aspect-ratio: 16 / 9;
    background: var(--card-bg-color, rgba(32, 32, 32, 0.95));
    border: 1px solid var(--border-color, #404040);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Fallback button: hidden by default, shown when viewport < 1800px instead of embed */
.video-fallback-btn {
    display: none;
    text-decoration: none;
    text-align: center;
    color: white;
}

.video-fallback-btn:link,
.video-fallback-btn:visited,
.video-fallback-btn:hover,
.video-fallback-btn:active {
    color: white;
    text-decoration: none;
}

/* 500–1799 visual tier: same stacked card as former 500–999 (compact <500 overrides card width). No embed — Vimeo in .auth-links. */
@media (max-width: 1799px) {
    .video-section {
        display: none;
    }

    .auth-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .auth-card {
        max-width: 500px;
    }
}

/* Vimeo in .auth-links (not compact); same range as stacked tier above */
@media (min-width: 500px) and (max-width: 1799px) {
    .login-page .login-vimeo--mid.video-fallback-btn {
        display: block;
        width: 100%;
        padding: 12px 24px;
        margin: 20px 0 0 0;
        line-height: 1.2;
        box-sizing: border-box;
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header .auth-logo {
    display: block;
    max-width: 260px;
    height: auto;
    margin: 0 auto;
}

.auth-form {
    margin-bottom: 0;
}

.form-group {
    margin-bottom: 20px;
}

.early-access-notice {
    color: #4a9eff;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-color, #e0e0e0);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color, #404040);
    border-radius: 4px;
    background: var(--input-bg-color, #2a2a2a);
    color: var(--text-color, #e0e0e0);
    font-size: 16px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color, #4a9eff);
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

.auth-btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: 500;
    margin-top: 10px;
    background: var(--primary-color, #4a9eff);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.auth-btn:hover {
    background: var(--primary-color-hover, #357abd);
}

.auth-links {
    text-align: center;
    padding-top: 20px;
}

.auth-links h2 {
    margin: 20px 0 0 0;
}

.auth-links h2:first-child {
    margin-top: 0;
}

.auth-links p {
    margin: 10px 0;
    color: var(--text-color-muted, #888);
}

.auth-link {
    display: inline-block;
    width: 100%;
    padding: 12px;
    background: var(--primary-color, #4a9eff);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    margin: 0;
    transition: background-color 0.2s;
    box-sizing: border-box;
}

.auth-link:hover {
    background: var(--primary-color-hover, #357abd);
    text-decoration: none;
}

.forgot-password-link {
    margin-top: 8px;
    text-align: right;
}

.forgot-link {
    color: var(--text-color-muted, #888);
    text-decoration: none;
    font-size: 14px;
}

.forgot-link:hover {
    color: var(--primary-color, #4a9eff);
    text-decoration: underline;
}

/* Wide submit label vs compact (<500px) */
.login-btn-label-compact {
    display: none;
}

@media (max-width: 499px) {
    .login-btn-label-wide {
        display: none;
    }

    .login-btn-label-compact {
        display: inline;
    }
}

/* Mid + wide tiers: early access, Vimeo fallback strip, h2 signup links */
@media (max-width: 499px) {
    .login-tier-mid-wide {
        display: none !important;
    }
}

/* Compact tier: stacked signup / Vimeo (matches former login_mobile layout) */
.auth-links-compact {
    display: none;
}

@media (max-width: 499px) {
    .auth-links-compact {
        display: block;
    }
}

.login-compact-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 18px;
}

/* On narrow login, Login → first action uses the same 8px rhythm; larger break sits after disposable (below) */
@media (max-width: 499px) {
    .login-page .login-compact-buttons {
        margin-top: 8px;
    }
}

.login-compact-btn {
    width: 100%;
    padding: 10px;
    font-size: 15px;
    font-weight: 500;
    margin: 0;
    background: var(--primary-color, #4a9eff);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    box-sizing: border-box;
    display: block;
    text-align: center;
    text-decoration: none;
    font-family: inherit;
}

.login-compact-btn:hover,
.login-compact-btn:focus,
.login-compact-btn:active {
    background: var(--primary-color-hover, #357abd);
    color: white;
    text-decoration: none;
}

.login-compact-btn:visited,
.login-compact-btn-link:visited {
    color: white;
    text-decoration: none;
}

.login-compact-btn-link {
    margin: 0;
}

.login-compact-btn-link:hover,
.login-compact-btn-link:focus,
.login-compact-btn-link:active {
    text-decoration: none;
}

/* Larger break after disposable signup; must follow .login-compact-btn so margin: 0 doesn't win */
.login-compact-btn.login-compact-btn-after-disposable-gap {
    margin-top: 22px;
}

@media (max-width: 499px) {
    /* Transparent body so screensaver fills viewport (same idea as former mobile login) */
    html:has(.login-page) {
        background: var(--bg-color, #1a1a1a);
    }

    body:has(.login-page) {
        background: transparent;
        overflow: hidden;
    }

    body:has(.login-page) *,
    body:has(.login-page) *::before,
    body:has(.login-page) *::after {
        box-sizing: border-box;
    }

    .login-page.auth-container {
        min-height: 100vh;
        min-height: 100dvh;
        align-items: center;
        padding: 12px;
        overflow-x: hidden;
    }

    .login-page .auth-card {
        max-height: none;
        overflow-y: visible;
        padding: 16px 20px;
        max-width: 320px;
    }

    .login-page .auth-header {
        margin-bottom: 12px;
    }

    .login-page .auth-header .auth-logo {
        max-width: 200px;
    }

    .login-page .auth-form .form-group {
        margin-bottom: 10px;
    }

    .login-page .auth-form .form-group label {
        margin-bottom: 3px;
        font-size: 14px;
    }

    .login-page .form-control {
        padding: 8px 10px;
    }

    .login-page .forgot-link {
        font-size: 13px;
    }

    .login-page .auth-btn {
        padding: 10px;
        font-size: 15px;
        margin-top: 6px;
    }
}
