/*
 * Login Modal — Minimal Styles
 */

/* Modal overlay */
.login-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* When opened via JS (display: flex is set inline) */
.login-modal-overlay[style*="display: flex"] {
    opacity: 1;
}

/* Modal content */
.login-modal {
    background: #ffffff;
    width: 100%;
    max-width: 500px;
    padding: 3rem 2.5rem;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.2s ease;
}

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

/* Close button */
.login-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    transition: color 0.15s ease;
}

.login-modal-close:hover {
    color: #1a1a1a;
    background: transparent;
}

.login-modal-close svg {
    width: 20px;
    height: 20px;
}

/* Header */
.login-modal-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-modal-logo {
    width: 32px;
    height: 32px;
    margin: 0 auto 1rem;
    display: block;
    object-fit: contain;
}

.login-modal h2,
.login-modal h3 {
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.login-modal .login-subtitle,
.login-modal p#loginModalSubtitle {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 2rem;
}

/* Form elements */
.login-modal-body {
    margin-top: 1rem;
}

.login-form-group {
    margin-bottom: 1.25rem;
}

.login-modal fieldset {
    margin-bottom: 1.25rem;
}

.login-modal label,
.login-form-group label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #666;
    margin-bottom: 0.5rem;
}

.login-form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.login-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    text-transform: none;
    letter-spacing: 0;
    color: #333;
    cursor: pointer;
}

.login-checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.login-forgot-link {
    font-size: 0.85rem;
    color: #666;
    text-decoration: none;
}

.login-forgot-link:hover {
    color: #1a1a1a;
}

.login-alert {
    display: none;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    border-radius: 0;
}

.login-alert.error {
    display: block;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.login-alert.success {
    display: block;
    background: #f0fdf4;
    border: 1px solid #22c55e;
    color: #15803d;
}

.login-divider {
    text-align: center;
    margin: 2rem 0;
    position: relative;
    color: #999;
    font-size: 0.75rem;
}

.login-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e5e5e5;
}

.login-divider span {
    background: #fff;
    padding: 0 1rem;
    position: relative;
}

.login-signup-text {
    text-align: center;
    font-size: 0.85rem;
    color: #666;
    margin-top: 1.5rem;
}

.login-signup-text a {
    color: #1a1a1a;
    text-decoration: none;
}

.login-signup-text a:hover {
    text-decoration: underline;
}

.twofa-hint {
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.login-back-btn {
    width: 100%;
    margin-top: 1rem;
    background: transparent;
    color: #666;
    border: 1px solid #e5e5e5;
}

.login-back-btn:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

.login-modal input[type="email"],
.login-modal input[type="password"],
.login-modal input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e5e5e5;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.15s ease;
}

.login-modal input:focus {
    outline: none;
    border-color: #1a1a1a;
}

.login-modal input::placeholder {
    color: #999;
}

/* Submit button */
.login-modal button[type="submit"] {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: #1a1a1a;
    color: #ffffff;
    border: 1px solid #1a1a1a;
    font-size: 0.75rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    cursor: pointer;
    transition: background 0.15s ease;
    margin-top: 0.5rem;
}

.login-modal button[type="submit"]:hover {
    background: #333;
}

.login-modal button[type="submit"]:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Error message */
.login-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

/* 2FA specific styles */
.login-modal .twofa-form {
    text-align: center;
}

.login-modal .twofa-code-input {
    font-size: 1.5rem;
    letter-spacing: 0.5em;
    text-align: center;
    padding: 1rem;
}

.login-modal .twofa-instructions {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 1.5rem;
}

/* Back link */
.login-modal .back-link {
    display: block;
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: #666;
}

.login-modal .back-link:hover {
    color: #1a1a1a;
}

/* Footer links */
.login-modal-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f0f0f0;
    text-align: center;
    font-size: 0.85rem;
    color: #666;
}

.login-modal-footer a {
    color: #1a1a1a;
}
