/* LOGIN PAGE STYLES */

/* Skip Link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: #d4af37;
    color: #1a1a1a;
    padding: 12px 20px;
    z-index: 9999;
    transition: top 0.3s ease;
    text-decoration: none;
    font-weight: 600;
    border-bottom-right-radius: 8px;
}
.skip-link:focus { 
    top: 0; 
    outline: 3px solid #ffffff; 
}

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

html { 
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', 'Roboto', sans-serif;
    color: #f7fafc;
    overflow-x: hidden;
    line-height: 1.6;
    background: linear-gradient(180deg, 
        hsl(215, 65%, 22%) 0%, 
        hsl(210, 50%, 18%) 50%, 
        hsl(205, 45%, 16%) 100%);
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Image overflow prevention */
img {
    max-width: 100%;
    height: auto;
}

/* Text wrapping */
.login-subtitle,
.help-text,
.security-notice p,
.footer-section p {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Watermark & Texture */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('janus-lodge-badge.png');
    background-size: 60vw 60vw;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(212, 175, 55, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.01) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Keyboard navigation focus indicators */
.keyboard-navigation *:focus {
    outline: 3px solid #d4af37 !important;
    outline-offset: 2px !important;
}

/* Header */
.header {
    background: linear-gradient(135deg, 
        hsl(225, 55%, 15%) 0%, 
        hsl(220, 60%, 17%) 25%, 
        hsl(218, 62%, 19%) 50%, 
        hsl(216, 64%, 21%) 75%, 
        hsl(215, 65%, 22%) 100%);
    padding: 2rem 0;
    position: relative;
    z-index: 10;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
}

.lodge-section, 
.logo-section {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.lodge-text {
    display: flex;
    flex-direction: column;
}

/* UPDATED: smooth scaling across widths */
.lodge-badge { 
    width: clamp(96px, 12vw, 156px);
    height: clamp(96px, 12vw, 156px);
    object-fit: contain; 
}

.right-badge { 
    width: clamp(80px, 10vw, 130px);
    height: clamp(80px, 10vw, 130px);
    object-fit: contain; 
}

.lodge-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
}

.lodge-subtitle {
    font-size: 1.1rem;
    color: #d4af37;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.lodge-details-header {
    font-size: 0.9rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;          /* UPDATED: prevents edge-case overflow */
    justify-content: center;  /* UPDATED: looks nicer when it wraps */
}

.nav-link {
    color: #cbd5e0;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem;
    display: inline-flex;
    align-items: center;
    min-height: 48px; /* UPDATED: 48px tap target */
}

.nav-link:hover { 
    color: #d4af37; 
}

.nav-link:focus {
    outline: 3px solid #d4af37;
    outline-offset: 2px;
}

/* Main Content - Login Section */
.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    position: relative;
    z-index: 10;
}

.login-container {
    width: 100%;
    max-width: 500px;
}

.login-card {
    background: linear-gradient(145deg, 
        rgba(26, 32, 44, 0.95) 0%, 
        rgba(26, 32, 44, 0.85) 100%);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

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

.login-title {
    font-size: 2.2rem;
    font-weight: 600;
    color: #d4af37;
    margin-bottom: 0.75rem;
}

.login-subtitle {
    font-size: 1.1rem;
    color: #94a3b8;
    line-height: 1.6;
}

.form-group {
    margin-bottom: 1.75rem;
}

.form-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    color: #cbd5e0;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: rgba(26, 32, 44, 0.7);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 10px;
    color: #f7fafc;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    min-height: 48px; /* UPDATED */
}

/* ---- Prevent browser autofill white background ---- */
input.form-input:-webkit-autofill,
input.form-input:-webkit-autofill:hover,
input.form-input:-webkit-autofill:focus,
input.form-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px rgba(26, 32, 44, 0.9) inset !important;
    box-shadow: 0 0 0 1000px rgba(26, 32, 44, 0.9) inset !important;
    -webkit-text-fill-color: #f7fafc !important;
    caret-color: #f7fafc;
    border: 1px solid rgba(212, 175, 55, 0.4);
    transition: background-color 9999s ease-in-out 0s;
}

.form-input:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.4);
    background: rgba(26, 32, 44, 0.9);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.message {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    display: none;
    animation: slideIn 0.3s ease;
}

.message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.message.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.message.show { 
    display: block; 
}

@keyframes slideIn {
    from { 
        opacity: 0; 
        transform: translateY(-10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.remember-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 48px; /* UPDATED */
}

.checkbox-input {
    width: 20px;
    height: 20px;
    accent-color: #d4af37;
    cursor: pointer;
}

.checkbox-label {
    color: #cbd5e0;
    font-size: 0.9rem;
    cursor: pointer;
}

.login-button {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #d4af37, #b8941f);
    color: #1a1a1a;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    min-height: 48px;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.3);
    background: linear-gradient(135deg, #e0bc43, #c4a02b);
}

.login-button:focus {
    outline: 3px solid #d4af37;
    outline-offset: 2px;
}

.divider {
    display: flex;
    align-items: center;
    margin: 2rem 0;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: rgba(212, 175, 55, 0.2);
}

.divider-text {
    padding: 0 1rem;
    color: #94a3b8;
    font-size: 0.9rem;
}

.help-section {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(212, 175, 55, 0.1);
}

.help-text {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.help-link {
    color: #d4af37;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    display: inline-block;
    min-height: 48px; /* UPDATED */
    padding: 0.5rem;
}

.help-link:hover {
    color: #b8941f;
    text-decoration: underline;
}

.help-link:focus {
    outline: 3px solid #d4af37;
    outline-offset: 2px;
}

.admin-login-link {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: #d4af37;
    opacity: 0.7;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.admin-login-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.admin-login-link:focus {
    outline: 3px solid #d4af37;
    outline-offset: 2px;
}

.security-notice {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(212, 175, 55, 0.05) 100%);
    padding: 1.25rem;
    border-radius: 10px;
    border-left: 4px solid #d4af37;
    margin-top: 1.5rem;
}

.security-notice p {
    color: #cbd5e0;
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0;
}

.security-notice strong { 
    color: #d4af37; 
}

/* Footer */
.footer {
    background: linear-gradient(135deg, 
        hsl(225, 55%, 15%) 0%, 
        hsl(220, 60%, 17%) 25%, 
        hsl(218, 62%, 19%) 50%, 
        hsl(216, 64%, 21%) 75%, 
        hsl(215, 65%, 22%) 100%);
    padding: 3rem 0 2rem;
    margin-top: auto;
    position: relative;
    z-index: 10;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: #d4af37;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.footer-section p, 
.footer-section a {
    color: #cbd5e0;
    font-size: 0.9rem;
    line-height: 1.6;
    text-decoration: none;
}

.footer-section a:hover { 
    color: #d4af37; 
}

.footer-section a:focus {
    outline: 3px solid #d4af37;
    outline-offset: 2px;
}

.footer-links { 
    list-style: none; 
}

.footer-links li { 
    margin-bottom: 0.5rem; 
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.8rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .header-container, 
    .footer-container { 
        padding: 0 3rem; 
    }
}

@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 2rem;
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    .logo-section { 
        flex-direction: column; 
        gap: 1rem; 
    }
    
    .nav-links { 
        flex-wrap: wrap; 
        justify-content: center; 
        gap: 1rem; 
        width: 100%; 
    }
    
    .nav-link { 
        padding: 0.8rem 1rem; 
        background: rgba(255, 255, 255, 0.05); 
        border-radius: 6px; 
        width: calc(50% - 0.5rem); 
        text-align: center;
        min-height: 48px;
        justify-content: center;
    }
    
    .lodge-title { 
        font-size: 2rem; 
    }
    
    .login-card { 
        padding: 2rem; 
    }
    
    .login-title { 
        font-size: 1.8rem; 
    }
    
    .footer-container { 
        padding: 0 2rem; 
    }
    
    .footer-grid { 
        grid-template-columns: 1fr; 
    }
    
    .main-content { 
        padding: 3rem 1.5rem; 
    }
    
    .remember-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    body::after {
        background-size: 85vw 85vw;
    }
}

@media (max-width: 480px) {
    .lodge-title { 
        font-size: 1.8rem; 
    }
    
    .login-card { 
        padding: 1.5rem; 
    }
    
    .login-title { 
        font-size: 1.6rem; 
    }
    
    .login-subtitle { 
        font-size: 1rem; 
    }
    
    .footer-container { 
        padding: 0 1rem; 
    }
    
    .nav-link { 
        width: 100%; 
    }
    
    .main-content { 
        padding: 2rem 1rem; 
    }
    
    .checkbox-input {
        width: 24px;
        height: 24px;
    }

    .login-button {
        padding: 1rem;
        font-size: 1rem;
    }

    .form-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Watermark behaviour on short/landscape viewports */
@media (max-height: 500px) {
    body::after {
        background-size: 45vh 45vh;
    }
}
