/* bHunt auth shell — Login + Register (shared; required for SPA swaps between auth pages) */

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

html {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

body[data-spa-shell="auth"] {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c2a 0%, #2f5d3a 50%, #1e3c2a 100%);
    min-height: 100vh;
    min-width: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}

body[data-spa-shell="auth"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('/images/backgrounds/layer-bg.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.15;
    z-index: 0;
    pointer-events: none;
}

body[data-spa-shell="auth"] #spa-content {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 40px);
}

body[data-spa-shell="auth"] .page-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container,
.register-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 450px;
    padding: 20px;
    margin-inline: auto;
}

.register-container {
    max-width: 550px;
}

.back-button {
    position: fixed;
    top: max(20px, env(safe-area-inset-top));
    left: max(20px, env(safe-area-inset-left));
    z-index: 100;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 10px 20px;
    border-radius: 50px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    min-height: 44px;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-5px);
    color: #fff;
}

.login-card,
.register-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.register-card {
    max-height: 90vh;
    overflow-y: auto;
}

.logo-section {
    text-align: center;
    margin-bottom: 30px;
}

.logo-section img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin-bottom: 15px;
}

.logo-section h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #2f5d3a;
    margin-bottom: 5px;
}

.logo-section p {
    color: #666;
    font-size: 0.95rem;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-label {
    font-weight: 600;
    color: #2f5d3a;
    margin-bottom: 8px;
    display: block;
    font-size: 0.9rem;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #2f5d3a;
    font-size: 1.1rem;
    z-index: 2;
    pointer-events: none;
}

.form-control {
    width: 100%;
    padding: 14px 14px 14px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fff;
    min-height: 44px;
}

.form-control:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.form-control.is-invalid {
    border-color: #dc3545;
}

.form-control.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-control::placeholder {
    color: #999;
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 5px;
    font-size: 0.875rem;
    color: #dc3545;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 10px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #28a745;
}

.form-check-label {
    color: #555;
    font-size: 0.9rem;
    cursor: pointer;
    margin: 0;
}

.forgot-password {
    color: #28a745;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.forgot-password:hover {
    color: #20c997;
    text-decoration: underline;
}

.btn-login,
.btn-register {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #28a745, #20c997);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    margin-top: 10px;
    min-height: 44px;
}

.btn-login:hover:not(:disabled),
.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.4);
    background: linear-gradient(135deg, #20c997, #28a745);
    color: #fff;
}

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

.register-section,
.login-section {
    text-align: center;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #e0e0e0;
}

.register-section p,
.login-section p {
    color: #666;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.register-link,
.login-link {
    color: #28a745;
    text-decoration: none;
    font-weight: 600;
}

.register-link:hover,
.login-link:hover {
    color: #20c997;
    text-decoration: underline;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

.session-expired-alert {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border-radius: 10px;
}

.quiz-role-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 30, 22, 0.72);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.quiz-role-modal {
    background: #fff;
    border-radius: 18px;
    max-width: 440px;
    width: 100%;
    padding: 28px 26px 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
    text-align: center;
}

.quiz-role-modal-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff3cd, #ffe69c);
    color: #856404;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.quiz-role-modal h3 {
    color: #1e3c2a;
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.quiz-role-modal p {
    color: #5c6670;
    line-height: 1.6;
    margin-bottom: 22px;
    font-size: 0.96rem;
}

.quiz-role-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-role-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.quiz-role-modal-btn.primary {
    background: linear-gradient(135deg, #1e3c2a, #2f5d3a);
    color: #fff;
}

.quiz-role-modal-btn.secondary {
    background: #f1f3f5;
    color: #495057;
}

@media (max-width: 768px) {
    body[data-spa-shell="auth"] {
        padding: max(15px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(15px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    }

    .login-container,
    .register-container {
        padding: 0 10px;
        max-width: 100%;
    }

    .login-card,
    .register-card {
        padding: 36px 28px;
        border-radius: 18px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

@media (max-width: 575.98px) {
    .register-card {
        max-height: 85vh;
    }

    .back-button {
        top: max(10px, env(safe-area-inset-top));
        left: max(10px, env(safe-area-inset-left));
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .logo-section img {
        width: 70px;
        height: 70px;
    }

    .logo-section h1 {
        font-size: 1.5rem;
    }

    .form-control {
        padding: 12px 12px 12px 42px;
        font-size: 0.95rem;
    }

    .input-icon {
        left: 12px;
        font-size: 1rem;
    }

    .btn-login,
    .btn-register {
        padding: 12px;
        font-size: 1rem;
    }

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

@media (max-width: 374px) {
    .register-card {
        max-height: 90vh;
        padding: 22px 20px;
    }

    .logo-section h1 {
        font-size: 1.3rem;
    }
}
