/**
 * Authentication Page Styles
 * Login page styling - Dark Mode Only
 */

/* Prefer system fonts; avoid missing TTF requests. */

:root {
    --bg: #000000;
    --card: #212121;
    --card-border: #2a2a2a;
    --text: #ffffff;
    --muted: #bdbdbd;
    --accent: #EBA338;
    --danger: #f44336;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.75);
    --radius: 12px;
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI Variable", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
}

@supports (min-height: 100dvh) {
    body {
        min-height: 100dvh;
    }
}

.login-wrapper {
    width: 100%;
    max-width: 460px;
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    margin: auto 0;
}

.login-box {
    background-color: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--card-border);
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-logo {
    max-width: 120px;
    margin-bottom: 0.75rem;
    width: 100%;
    height: auto;
}

.login-header h1 {
    color: var(--text);
    font-size: clamp(1.05rem, 1rem + 0.6vw, 1.35rem);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

.login-separator {
    height: 2px;
    background: linear-gradient(90deg, transparent, #EBA338, transparent);
    margin: 0.75rem 0;
}

.tbasep-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.input-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-field label {
    color: var(--text);
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
}

.input-field input {
    padding: 0.875rem 2.5rem 0.875rem 1rem;
    background-color: #ffffff;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    color: #000000;
    font-size: 16px; /* Prevents zoom on iOS */
    transition: all 0.3s ease;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
}

.input-field input::placeholder {
    color: #666666;
}

.input-field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(235, 163, 56, 0.14);
}

.input-field input:focus-visible {
    outline: none;
}

.password-wrapper {
    position: relative;
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 1.2rem;
    user-select: none;
    color: #666666;
    transition: color 0.3s ease;
    z-index: 10;
    padding: 0.25rem;
    background-color: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    line-height: 1;
}

.password-toggle:hover {
    color: #000000;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    flex: 1;
    min-width: 120px;
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #EBA338;
    flex-shrink: 0;
}

.forgot-password-link {
    color: var(--danger);
    text-decoration: none;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.forgot-password-link:hover {
    opacity: 0.8;
}

.btn-login {
    width: 100%;
    padding: 0.875rem;
    background-color: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
    min-height: 48px;
}

@media (hover: hover) and (pointer: fine) {
    .btn-login:hover {
        background-color: #d4941f;
        transform: translateY(-1px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    }
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.error-box {
    background-color: rgba(244, 67, 54, 0.2);
    border: 1px solid #f44336;
    color: #f44336;
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.success-box {
    background-color: rgba(76, 175, 80, 0.2);
    border: 1px solid #4caf50;
    color: #4caf50;
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.form-separator {
    height: 2px;
    background: linear-gradient(90deg, transparent, #EBA338, transparent);
    margin: 1.5rem 0;
}

.login-footer {
    text-align: center;
    color: var(--muted);
    font-size: 0.7rem;
    margin-top: 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
}

.login-footer p {
    margin: 0;
    padding: 0 0.5rem;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    box-sizing: border-box;
}

.modal-content {
    background-color: var(--card);
    border-radius: 12px;
    padding: 0;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid #2a2a2a;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    box-sizing: border-box;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #2a2a2a;
}

.modal-header h3 {
    color: var(--accent);
    margin: 0;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
    line-height: 1;
}

.modal-close:hover {
    color: #EBA338;
}

.modal-body {
    padding: 1.5rem;
}

.modal-body p {
    color: var(--text);
    margin-bottom: 1.25rem;
    line-height: 1.6;
    font-size: 0.9rem;
}

/* Very short screens (e.g. iPhone SE landscape / Safari bars): reduce vertical density */
@media (max-height: 740px) {
    .login-wrapper {
        margin: 0;
    }
    .login-header {
        margin-bottom: 1rem;
    }
    .login-logo {
        max-width: 96px;
        margin-bottom: 0.4rem;
    }
    .form-separator {
        margin: 1rem 0;
    }
    .login-footer {
        display: none;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .login-wrapper {
        padding: 0.75rem;
        max-width: 100%;
    }

    .login-box {
        padding: 1.25rem;
        border-radius: 8px;
    }

    .login-header {
        margin-bottom: 1.25rem;
    }

    .login-logo {
        max-width: 100px;
        margin-bottom: 0.5rem;
    }

    .login-header h1 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    .tbasep-form {
        gap: 1rem;
    }

    .input-field label {
        font-size: 0.75rem;
    }

    .input-field input {
        padding: 0.75rem 2.25rem 0.75rem 0.875rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .password-toggle {
        right: 10px;
        width: 28px;
        height: 28px;
        font-size: 1.1rem;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .remember-me {
        width: 100%;
        font-size: 0.7rem;
    }

    .forgot-password-link {
        width: 100%;
        text-align: left;
        font-size: 0.7rem;
    }

    .btn-login {
        padding: 0.875rem;
        font-size: 0.9rem;
    }

    .login-footer {
        font-size: 0.65rem;
        margin-top: 0.75rem;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        border-radius: 8px;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-header h3 {
        font-size: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .login-wrapper {
        padding: 0.5rem;
    }

    .login-box {
        padding: 1rem;
    }

    .login-header h1 {
        font-size: 1rem;
    }

    .input-field input {
        padding: 0.7rem 2rem 0.7rem 0.75rem;
    }

    .password-toggle {
        right: 8px;
        width: 24px;
        height: 24px;
        font-size: 1rem;
    }
}
