/* ============================================
   AUTH PAGES STYLESHEET - NCC.training
   For login.html and register.html
   ============================================ */

/* ==========================================
   Auth Section Layout
   ========================================== */

.auth-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-navy-dark) 50%, var(--brand-navy) 100%);
    padding: 100px 20px 40px;
    position: relative;
    overflow: hidden;
}

/* Animated Background Pattern */
.auth-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255,255,255,.02) 35px, rgba(255,255,255,.02) 70px),
        repeating-linear-gradient(-45deg, transparent, transparent 35px, rgba(255,255,255,.02) 35px, rgba(255,255,255,.02) 70px);
    animation: bgMove 20s linear infinite;
    pointer-events: none;
}

@keyframes bgMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(70px, 70px); }
}

.auth-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.auth-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: grid;
    grid-template-columns: 40% 60%;
    min-height: 600px;
    animation: slideUp 0.6s ease-out;
}

.auth-card-wide {
    grid-template-columns: 35% 65%;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   Auth Branding (Left Side)
   ========================================== */

.auth-branding {
    background: linear-gradient(165deg, var(--brand-navy) 0%, var(--brand-navy-dark) 100%);
    color: #fff;
    padding: 50px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-branding::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(106,170,215,0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

.auth-branding-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.auth-logo {
    /* Side-panel logo on register/login. The ncc-logo.png wordmark renders
       the brand name in NAVY ink with the tri-colour arrow mark above. On
       the navy gradient side-panel, both the navy text and the middle
       navy stroke of the arrow are invisible without a light backdrop.
       Use a solid white badge (not a translucent frosted frame) so every
       colour in the lockup reads cleanly. */
    display: block;
    width: auto;
    height: 160px;
    max-width: 360px;
    margin: 0 auto 26px;
    object-fit: contain;
    background: #ffffff;
    padding: 16px 24px;
    border-radius: 16px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.30);
}

.auth-branding h1 {
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--brand-sky-light);
}

.auth-branding > p,
.auth-branding-content > p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
}

/* Auth Features */
.auth-features {
    margin: 30px 0;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.auth-feature:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.auth-feature i {
    font-size: 1.5rem;
    color: var(--brand-sky-light);
}

.auth-feature span {
    font-size: 0.95rem;
    color: #fff;
}

/* Auth Quote */
.auth-quote {
    margin-top: 40px;
    padding: 20px;
    border-left: 4px solid var(--brand-sky-light);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.auth-quote i {
    color: var(--brand-sky-light);
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.auth-quote p {
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 1.1rem;
    font-style: italic;
    margin: 10px 0;
    color: #fff;
}

.auth-quote span {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Registration Stats */
.registration-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 30px;
}

.stat-item {
    text-align: center;
    padding: 15px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.stat-item strong {
    display: block;
    font-size: 1.5rem;
    color: var(--brand-sky-light);
    font-family: 'Montserrat', system-ui, sans-serif;
    margin-bottom: 5px;
}

.stat-item span {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
}

/* ==========================================
   Auth Form Container (Right Side)
   ========================================== */

.auth-form-container {
    padding: 50px 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.auth-form-content {
    width: 100%;
    max-width: 500px;
}

.auth-form-content h2 {
    font-family: 'Montserrat', system-ui, sans-serif;
    color: var(--brand-navy);
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.auth-subtitle {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 30px;
}

/* ==========================================
   Form Styles
   ========================================== */

.auth-form {
    width: 100%;
}

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

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

.form-group label i {
    color: var(--brand-navy);
    margin-right: 5px;
    width: 16px;
}

.required {
    color: #e74c3c;
    margin-left: 2px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-family: 'Montserrat', system-ui, sans-serif;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--brand-navy);
    box-shadow: 0 0 0 4px rgba(0,45,98,0.1);
}

.form-group input.error,
.form-group select.error {
    border-color: #e74c3c;
}

.form-group input.success,
.form-group select.success {
    border-color: #27ae60;
}

.error-message {
    display: block;
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 5px;
    min-height: 20px;
}

/* Password Input Wrapper */
.password-input-wrapper {
    position: relative;
}

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

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: var(--brand-navy);
}

.password-toggle i {
    font-size: 1.1rem;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 10px;
}

.strength-bar {
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.strength-bar-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-bar-fill.weak {
    width: 25%;
    background: #e74c3c;
}

.strength-bar-fill.fair {
    width: 50%;
    background: #f39c12;
}

.strength-bar-fill.good {
    width: 75%;
    background: #3498db;
}

.strength-bar-fill.strong {
    width: 100%;
    background: #27ae60;
}

.strength-text {
    font-size: 0.85rem;
    color: #666;
}

.strength-text strong {
    color: #333;
}

/* Password Requirements */
.password-requirements {
    list-style: none;
    padding: 10px 0 0;
    margin: 0;
}

.password-requirements li {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.password-requirements li i {
    font-size: 0.5rem;
    color: #ccc;
}

.password-requirements li.met {
    color: #27ae60;
}

.password-requirements li.met i {
    color: #27ae60;
}

/* Form Row (Remember Me & Forgot Password) */
.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

/* Checkbox */
.form-group-checkbox {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;          /* allow .error-message to wrap to its own line */
    gap: 10px;
    margin-bottom: 20px;
}

.form-group-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin-top: 2px;
    flex-shrink: 0;
}

.form-group-checkbox label {
    font-size: 0.9rem;
    color: #555;
    cursor: pointer;
    margin: 0;
    line-height: 1.5;
}

/* Validation error for a required checkbox: full-width, red, visible.
   Without flex-basis:100% the .error-message gets squashed beside the
   checkbox+label and is effectively invisible — which is why submitting
   the registration form with unchecked required boxes used to "do nothing." */
.form-group-checkbox .error-message {
    flex-basis: 100%;
    width: 100%;
    margin-top: 4px;
    padding-left: 28px;       /* align under the label text, past the box */
    font-weight: 500;
}

.form-group-checkbox.has-error {
    padding: 8px 10px;
    border: 1px solid #e74c3c;
    border-radius: 6px;
    background: #fdecea;
}

.form-group-checkbox a {
    color: var(--brand-navy);
    text-decoration: none;
    font-weight: 600;
}

.form-group-checkbox a:hover {
    text-decoration: underline;
}

.forgot-link {
    color: var(--brand-navy);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.forgot-link:hover {
    text-decoration: underline;
}

/* Submit Button */
.btn-block {
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 10px;
}

.btn-block i {
    margin-right: 8px;
}

/* Divider */
.auth-divider {
    text-align: center;
    margin: 25px 0;
    position: relative;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background: #e0e0e0;
}

.auth-divider::before {
    left: 0;
}

.auth-divider::after {
    right: 0;
}

.auth-divider span {
    background: #fff;
    padding: 0 15px;
    color: #999;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

/* Social Login */
.social-login {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-social {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    background: #fff;
    color: #333;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-social:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #ccc;
}

.btn-social:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-google i {
    color: #DB4437;
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 25px;
}

.auth-footer p {
    color: #666;
    font-size: 0.95rem;
}

.auth-footer a {
    color: var(--brand-navy);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Auth Help */
.auth-help {
    margin-top: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.auth-help p {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
}

.auth-help i {
    color: #3498db;
    margin-right: 5px;
}

.auth-help a {
    color: var(--brand-navy);
    text-decoration: none;
    font-weight: 600;
}

.auth-help a:hover {
    text-decoration: underline;
}

/* ==========================================
   Responsive Design
   ========================================== */

@media (max-width: 1024px) {
    .auth-card {
        grid-template-columns: 1fr;
    }
    
    .auth-card-wide {
        grid-template-columns: 1fr;
    }
    
    .auth-branding {
        padding: 40px 30px;
        min-height: 300px;
    }
    
    .auth-logo {
        width: auto;
        height: 110px;
        max-width: 280px;
        padding: 10px 16px;
    }
    
    .auth-branding h1 {
        font-size: 1.6rem;
    }
    
    .auth-features {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .registration-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .auth-section {
        padding: 80px 15px 30px;
    }
    
    .auth-form-container {
        padding: 30px 25px;
    }
    
    .auth-form-content h2 {
        font-size: 1.5rem;
    }
    
    .auth-branding {
        padding: 30px 20px;
    }
    
    .auth-features {
        grid-template-columns: 1fr;
    }
    
    .registration-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .password-requirements {
        display: grid;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .auth-form-container {
        padding: 25px 20px;
    }
    
    .auth-branding {
        min-height: 250px;
    }
    
    .registration-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-item strong {
        font-size: 1.3rem;
    }
}

/* ==========================================
   Animations
   ========================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Form field focus animation */
.form-group input:focus,
.form-group select:focus {
    animation: focusPulse 0.3s ease;
}

@keyframes focusPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0,45,98,0.4);
    }
    100% {
        box-shadow: 0 0 0 4px rgba(0,45,98,0.1);
    }
}

/* ==========================================
   Print Styles
   ========================================== */

@media print {
    .auth-section {
        background: #fff;
    }
    
    .auth-branding {
        display: none;
    }
    
    .auth-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Non-affiliation disclaimer on auth cards */
.auth-disclaimer {
    font-size: 0.8rem;
    line-height: 1.5;
    color: #6b7280;
    text-align: center;
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid #eceff3;
}

/* Inline hint + optional-marker for the minimum-data registration form */
.field-hint {
    display: block;
    font-size: 0.78rem;
    color: #5b6b7f;
    margin-top: 4px;
    line-height: 1.4;
}

.optional-note {
    font-size: 0.78rem;
    font-weight: 500;
    color: #5b6b7f;
}

/* Account-type radio block on register.html. Two side-by-side cards: the
   user picks whether they are a cadet learner (default) or registering on
   behalf of a school. School path reveals two institutional fields below. */
.form-group-accounttype {
    border: 0;
    padding: 0;
    margin: 0 0 18px;
}
.form-group-accounttype legend {
    display: block;
    font-weight: 600;
    color: #1f2933;
    margin-bottom: 10px;
    font-size: 0.95rem;
}
.form-group-accounttype legend i {
    color: #002D62;
    margin-right: 6px;
}
.accounttype-radio {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border: 1.5px solid #d8dee9;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    background: #fff;
    transition: border-color .15s, background-color .15s;
}
.accounttype-radio:hover {
    border-color: #002D62;
    background: #f7f9fc;
}
.accounttype-radio input[type="radio"] {
    margin-top: 4px;
    accent-color: #002D62;
    flex-shrink: 0;
}
.accounttype-radio input[type="radio"]:checked ~ span strong {
    color: #002D62;
}
.accounttype-radio input[type="radio"]:checked + span {
    color: #002D62;
}
.accounttype-radio:has(input[type="radio"]:checked) {
    border-color: #002D62;
    background: #f0f4fa;
}
.accounttype-radio span {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.accounttype-radio strong {
    font-weight: 700;
    color: #1f2933;
    font-size: 0.95rem;
}
.accounttype-radio small {
    color: #5b6b7f;
    font-size: 0.82rem;
    line-height: 1.45;
    font-weight: 400;
}

/* Form-group-school is a regular .form-group — it just needs to be hidden
   by default. The `hidden` attribute does this in modern browsers but a
   CSS fallback ensures it on older runtimes. */
.form-group-school[hidden] {
    display: none !important;
}
