/* Login Page Styles - Matches dark theme */

/* IBM Plex Sans - Variable font for UI elements */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@100..700&display=swap');

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

:root {
    --border-radius: 10px;
    --fill-color-1: rgb(34, 34, 34);
    --fill-color-2: #000000;
    --text-color-1: #eee;
    --text-color-2: rgba(255, 255, 255, 0.4);
    --gradient: linear-gradient(-20deg, rgb(0, 0, 0), rgb(15, 29, 23), rgb(11, 48, 70));
    --active-color: rgb(146, 199, 0);
    --error-color: #d37461;

    /* UI Font (sans-serif for buttons, labels, etc.) */
    --ui-font: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --ui-font-weight-normal: 400;
    --ui-font-weight-medium: 500;
    --ui-font-weight-semibold: 600;
}

body {
    font-family: CMSerif, Georgia, serif;
    background: var(--gradient);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color-1);
}

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

.login-card {
    background: rgba(34, 34, 34, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 48px 40px;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.4),
        0 0 80px rgba(146, 199, 0, 0.05);
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo {
    font-family: CMSerif, Georgia, serif;
    font-size: 1.4rem;
    font-weight: bold;
    letter-spacing: 0.3em;
    color: white;
    margin-bottom: 12px;
}

.login-subtitle {
    font-size: 0.95rem;
    color: var(--text-color-2);
    font-style: italic;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-family: var(--ui-font);
    font-size: 0.85rem;
    color: var(--text-color-2);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input {
    padding: 14px 16px;
    font-size: 1rem;
    font-family: var(--ui-font);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    color: var(--text-color-1);
    transition: all 0.2s ease;
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.form-group input:focus {
    outline: none;
    border-color: var(--active-color);
    box-shadow: 0 0 0 3px rgba(146, 199, 0, 0.15);
}

.error-message {
    padding: 12px 16px;
    background: rgba(211, 116, 97, 0.15);
    border: 1px solid rgba(211, 116, 97, 0.3);
    border-radius: var(--border-radius);
    color: var(--error-color);
    font-family: var(--ui-font);
    font-size: 0.9rem;
    display: none;
}

.error-message.visible {
    display: block;
}

.login-button {
    padding: 16px 24px;
    font-size: 1rem;
    font-family: var(--ui-font);
    font-weight: var(--ui-font-weight-medium);
    background: var(--active-color);
    color: #000;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-button:hover {
    background: rgb(166, 219, 20);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(146, 199, 0, 0.3);
}

.login-button:active {
    transform: translateY(0);
}

.login-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.login-footer {
    margin-top: 32px;
    text-align: center;
}

.back-link {
    color: var(--text-color-2);
    text-decoration: none;
    font-family: var(--ui-font);
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--text-color-1);
}

.register-link {
    color: var(--active-color);
    text-decoration: none;
    font-family: var(--ui-font);
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.register-link:hover {
    color: rgb(166, 219, 20);
}

.footer-separator {
    color: var(--text-color-2);
    margin: 0 12px;
}

/* Forgot Password Link */
.forgot-password-link {
    font-family: var(--ui-font);
    font-size: 0.8rem;
    color: var(--text-color-2);
    text-decoration: none;
    margin-top: 8px;
    display: inline-block;
    transition: color 0.2s ease;
}

.forgot-password-link:hover {
    color: var(--text-color-1);
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 8px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.divider span {
    padding: 0 16px;
    color: var(--text-color-2);
    font-family: var(--ui-font);
    font-size: 0.85rem;
}

/* Passkey Button */
.passkey-button {
    width: 100%;
    padding: 14px 24px;
    font-size: 0.95rem;
    font-family: var(--ui-font);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color-1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.passkey-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
}

.passkey-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.passkey-button .spinner {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: rgba(34, 34, 34, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 32px;
    width: 90%;
    max-width: 400px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-color-2);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--text-color-1);
}

.modal h2 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    text-align: center;
}

.modal p {
    font-family: var(--ui-font);
    font-size: 0.9rem;
    color: var(--text-color-2);
    text-align: center;
    margin-bottom: 24px;
}

.modal-step {
    display: none;
}

.modal-step.active {
    display: block;
}

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

.modal .login-button {
    width: 100%;
    margin-top: 8px;
}

/* Code Input */
.code-input {
    text-align: center;
    font-size: 1.3rem !important;
    letter-spacing: 0.4em;
    font-family: monospace;
}

/* Success Icon */
.success-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--active-color);
}

/* Responsive */
@media (max-width: 480px) {
    .login-card {
        padding: 36px 24px;
    }

    .login-logo {
        font-size: 1.8rem;
    }

    .modal {
        padding: 24px;
        margin: 16px;
    }
}
