/* Login Page Styles */

* {
    box-sizing: border-box;
}

body {
    background: url(../images/background4.jpg) no-repeat center center fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
    margin: 0;
    padding: 0;
    font-family: "Helvetica", "Arial", sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-container {
    background: rgba(0, 0, 0, 0.85);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 400px;
    margin: 20px;
}

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

.login-header h1 {
    color: white;
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 300;
}

.login-header p {
    color: #aaa;
    margin: 0;
    font-size: 14px;
}

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

.form-group label {
    display: block;
    color: #ccc;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #444;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
    transition: border-color 0.3s, background-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #007bff;
    background: rgba(255, 255, 255, 0.15);
}

.form-group input::placeholder {
    color: #888;
}

/* Password field with toggle */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    padding-right: 45px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover .eye-icon {
    color: #007bff;
}

.eye-icon {
    width: 22px;
    height: 22px;
    color: #888;
    transition: color 0.2s;
}

.eye-icon.hidden {
    display: none;
}

.login-button {
    width: 100%;
    padding: 14px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-button:hover {
    background: #0056b3;
}

.login-button:disabled {
    background: #555;
    cursor: not-allowed;
}

.error-message {
    background: rgba(220, 53, 69, 0.9);
    color: white;
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

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

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

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

.modal-content {
    background: #2a2a2a;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.modal-content h3 {
    color: white;
    margin: 0 0 15px 0;
}

.modal-content p {
    color: #ccc;
    margin: 0 0 20px 0;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.modal-buttons .btn-confirm {
    background: #007bff;
    color: white;
}

.modal-buttons .btn-confirm:hover {
    background: #0056b3;
}

.modal-buttons .btn-cancel {
    background: #6c757d;
    color: white;
}

.modal-buttons .btn-cancel:hover {
    background: #545b62;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
    vertical-align: middle;
}

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

/* MFA Code Input */
.mfa-form {
    text-align: center;
}

.mfa-icon {
    margin-bottom: 10px;
}

.mfa-prompt {
    color: #ccc;
    font-size: 14px;
    margin: 0 0 20px;
    line-height: 1.4;
}

.mfa-code-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.mfa-digit {
    width: 44px;
    height: 54px;
    text-align: center;
    font-size: 26px;
    font-weight: bold;
    border: 2px solid #444;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0;
    transition: border-color 0.2s, background-color 0.2s;
}

.mfa-digit:focus {
    border-color: #007bff;
    background: rgba(255, 255, 255, 0.15);
    outline: none;
}

.mfa-separator {
    color: #666;
    font-size: 20px;
    font-weight: bold;
    margin: 0 2px;
}

.mfa-button {
    margin-top: 0;
}

.mfa-cancel,
.forgot-cancel {
    display: block;
    text-align: center;
    color: #888;
    font-size: 13px;
    margin-top: 15px;
    text-decoration: none;
    transition: color 0.2s;
}

.mfa-cancel:hover,
.forgot-cancel:hover {
    color: #ccc;
}

/* Forgot Password */
/* Passkey sign-in */
.passkey-block[hidden] {
    display: none;
}

.passkey-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0 14px;
    color: #888;
    font-size: 13px;
}

.passkey-divider::before,
.passkey-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid #444;
}

.passkey-button {
    width: 100%;
    padding: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    color: #fff;
    border: 1px solid #007bff;
    border-radius: 4px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.passkey-button:hover {
    background: rgba(0, 123, 255, 0.15);
}

.passkey-button:focus-visible {
    outline: 2px solid #8cb4f0;
    outline-offset: 2px;
}

.passkey-button:disabled {
    border-color: #555;
    color: #999;
    cursor: not-allowed;
}

.passkey-hint {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.4;
    color: #888;
    text-align: center;
}

.forgot-password-link {
    display: block;
    text-align: center;
    color: #6c8ebf;
    font-size: 13px;
    margin-top: 15px;
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-password-link:hover {
    color: #8cb4f0;
}

.forgot-prompt {
    color: #aaa;
    font-size: 14px;
    margin: 0 0 20px;
    line-height: 1.5;
    text-align: center;
}

.success-message {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

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

/* Trust device checkbox */
.trust-device-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #aaa;
    font-size: 13px;
    margin: 12px 0 16px;
    cursor: pointer;
    justify-content: center;
}
.trust-device-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #007bff;
    cursor: pointer;
}
.trust-device-label span {
    user-select: none;
}

/* Responsive */
@media (max-width: 480px) {
    .login-container {
        padding: 30px 20px;
        margin: 10px;
    }

    .login-header h1 {
        font-size: 24px;
    }

    .mfa-digit {
        width: 38px;
        height: 46px;
        font-size: 22px;
    }

    .mfa-code-inputs {
        gap: 5px;
    }
}
