/* Login page — app/market light tokens, quiet card like settings/sidebar modals */

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

:root {
    --bg: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e8e8e8;
    --text: #1a1a1a;
    --text-muted: #888;
    --border: #ddd;
    --accent: #6d78d5;
    --accent-hover: #5b64b5;
    --error: #ef4444;
    --success: #27ae60;
}

body {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.login-header {
    display: flex;
    align-items: center;
    padding: 20px 40px;
    background: var(--bg);
}

.login-header .logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    line-height: 0;
}

.login-header .logo img {
    height: 26px;
    width: auto;
    display: block;
}

.login-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: var(--bg-secondary);
    border: none;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    padding: 20px 24px 24px;
}

.login-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    text-align: left;
    margin: 0 0 8px;
    line-height: 28px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

footer {
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-left {
    color: var(--text-muted);
    font-size: 12px;
}

.footer-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.footer-right a {
    color: var(--text-muted);
    font-size: 12px;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-right a:hover {
    color: var(--text);
}

.footer-sep {
    color: var(--text-muted);
    margin: 0 6px;
    font-size: 12px;
}


.auth-tabs {
    display: flex;
    gap: 0;
    margin: 0 0 20px;
    border-bottom: 1px solid var(--border);
}

.auth-tabs[hidden] {
    display: none;
}

.login-box .auth-tab {
    width: auto;
    background: none;
    border: none;
    border-radius: 0;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    padding: 10px 12px 10px 0;
    margin: 0 16px -1px 0;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.login-box .auth-tab:last-child {
    margin-right: 0;
}

.login-box .auth-tab:hover {
    background: none;
    color: var(--text);
}

.login-box .auth-tab.active {
    background: none;
    color: var(--text);
    box-shadow: none;
    border-bottom-color: var(--accent);
}

.login-box .auth-tab.active:hover {
    background: none;
    color: var(--text);
}

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

.form-group[hidden] {
    display: none;
}

.form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 12px;
    font-size: 13px;
    font-family: inherit;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.15s;
}

.form-group input:focus {
    border-color: var(--accent);
}

.form-group input:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    color: var(--text);
    -webkit-text-fill-color: var(--text);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.consent-block {
    margin: 4px 0 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.consent-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-muted);
}

.consent-row .consent-text,
.consent-row .consent-text label {
    cursor: pointer;
}

.consent-row .consent-text label {
    color: inherit;
}

.consent-row .consent-text a {
    margin: 0 0.25em;
}

.consent-row input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.consent-row a {
    color: var(--accent);
    text-decoration: none;
}

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

.login-submit {
    width: 100%;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 16px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.login-submit:hover {
    background: var(--accent-hover);
}

.login-submit:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
}

.login-submit[hidden] {
    display: none;
}

.error-message {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid var(--error);
    color: var(--error);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

.invite-email-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0 0 16px;
    line-height: 1.4;
}

.sent-to {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0 0 16px;
    line-height: 1.45;
    word-break: break-word;
}

.sent-to[hidden] {
    display: none;
}

#sent-to-email {
    color: var(--text);
    font-weight: 600;
}

.success-message {
    background: rgba(39, 174, 96, 0.08);
    border: 1px solid var(--success);
    color: var(--success);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

#code {
    text-align: center;
    letter-spacing: 6px;
    font-size: 18px;
    font-weight: 600;
}

.back-btn {
    display: block;
    width: auto;
    margin: 12px auto 0;
    padding: 8px 0 0;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 400;
    font-family: inherit;
    cursor: pointer;
}

.back-btn:hover {
    background: none;
    color: var(--text);
}

.back-btn:disabled {
    background: none;
    color: var(--text-muted);
    cursor: not-allowed;
}

.back-btn[hidden] {
    display: none;
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
    .login-header {
        padding: 16px 20px;
    }

    .login-container {
        padding: 16px;
    }

    .login-box {
        padding: 24px 20px 24px;
    }

    .login-title {
        font-size: 18px;
        line-height: 1.3;
        margin-bottom: 12px;
    }

    .login-box .auth-tab {
        font-size: 16px;
        padding: 12px 12px 14px 0;
        margin-right: 20px;
    }

    .form-group label {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .form-group input,
    #code {
        font-size: 16px;
        padding: 14px;
        min-height: 44px;
        border-radius: 8px;
    }

    #code {
        font-size: 22px;
        letter-spacing: 6px;
    }

    .consent-row {
        font-size: 14px;
        line-height: 1.5;
        gap: 12px;
    }

    .consent-row input[type="checkbox"] {
        width: 22px;
        height: 22px;
        margin-top: 2px;
    }

    .login-submit {
        font-size: 16px;
        padding: 14px 16px;
        min-height: 44px;
        border-radius: 8px;
    }

    .sent-to,
    .invite-email-hint,
    .back-btn {
        font-size: 14px;
    }

    .back-btn {
        min-height: 44px;
        padding: 12px 0 0;
    }

    .footer-left,
    .footer-right a,
    .footer-sep {
        font-size: 13px;
    }

    footer {
        padding: 16px 20px;
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: center;
        gap: 12px;
        overflow: hidden;
    }

    .footer-left {
        flex-shrink: 0;
        white-space: nowrap;
    }

    .footer-right {
        flex-wrap: nowrap;
        min-width: 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .footer-right a {
        white-space: nowrap;
    }
}
