/**
 * Gatewarden Login Page Styles
 * Uses CSS variables from theme.css
 */

/* ============================================
   LOGIN PAGE CONTAINER
   ============================================ */
.login-page {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: var(--gw-bg-color);
    z-index: 1;
}

/* ============================================
   HEADER OVERRIDE FOR LOGIN PAGE
   ============================================ */
.login-header {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(30, 30, 46, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--gw-radius-full);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

[data-theme="light"] .login-header {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Login page header home link */
.login-header .header-home-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    padding: 0.375rem 0.75rem;
    border-radius: var(--gw-radius-md);
    color: #a0a0a0;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.login-header .header-home-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

[data-theme="light"] .login-header .header-home-link {
    color: #666666;
}

[data-theme="light"] .login-header .header-home-link:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #1a1a1a;
}

/* Login page header controls styling */
.login-header .language-switcher {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.5rem;
    border-radius: var(--gw-radius-md);
    color: #a0a0a0;
    background: transparent;
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-header .language-switcher:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

[data-theme="light"] .login-header .language-switcher {
    color: #666666;
}

[data-theme="light"] .login-header .language-switcher:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #1a1a1a;
}

.login-header .language-switcher i {
    font-size: 1.125rem;
    color: #9bc832;
}

.login-header .language-switcher-button {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0;
    background: transparent;
    border: none;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    cursor: pointer;
}

/* Language dropdown menu styling */
.login-header .language-switcher-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: rgba(30, 30, 46, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--gw-radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    min-width: 120px;
    z-index: 1001;
    overflow: hidden;
}

[data-theme="light"] .login-header .language-switcher-menu {
    background: #ffffff;
    border-color: #e0e0e0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.login-header .language-option {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    color: #a0a0a0;
    text-decoration: none;
    font-size: 0.875rem;
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.login-header .language-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.login-header .language-option.active {
    color: #9bc832;
    font-weight: 600;
}

[data-theme="light"] .login-header .language-option {
    color: #666666;
}

[data-theme="light"] .login-header .language-option:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

[data-theme="light"] .login-header .language-option.active {
    color: #16a34a;
}

.login-header .theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0.375rem;
    border-radius: var(--gw-radius-md);
    color: #a0a0a0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-header .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

[data-theme="light"] .login-header .theme-toggle {
    color: #666666;
}

[data-theme="light"] .login-header .theme-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #1a1a1a;
}

.login-header .theme-toggle i {
    font-size: 1.125rem;
    color: #9bc832;
}

/* ============================================
   CENTERED LAYOUT
   ============================================ */
.centered-layout {
    justify-content: center;
    align-items: center;
    background: var(--gw-bg-color);
}

.centered-layout .brand-panel {
    display: none;
}

/* ============================================
   SPLIT LAYOUT
   ============================================ */
.split-layout .brand-panel {
    flex: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: linear-gradient(135deg, #1d3c34 0%, #152a24 50%, #0f1f1a 100%);
    position: relative;
    overflow: hidden;
}

/* Decorative arcs */
.split-layout .brand-panel::before {
    content: '';
    position: absolute;
    width: 700px;
    height: 700px;
    border: 3px solid rgba(var(--gw-accent-rgb), 0.25);
    border-radius: 50%;
    bottom: -250px;
    left: -150px;
    pointer-events: none;
    z-index: 1;
}

.split-layout .brand-panel::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border: 2px solid rgba(var(--gw-accent-rgb), 0.15);
    border-radius: 50%;
    bottom: -150px;
    left: -50px;
    pointer-events: none;
    z-index: 1;
}

.brand-content::before {
    content: '';
    position: fixed;
    width: 350px;
    height: 350px;
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    top: -100px;
    left: 30%;
    pointer-events: none;
    z-index: 0;
}

.brand-content::after {
    content: '';
    position: fixed;
    width: 250px;
    height: 250px;
    border: 2px solid rgba(var(--gw-accent-rgb), 0.12);
    border-radius: 50%;
    bottom: 10%;
    left: 45%;
    pointer-events: none;
    z-index: 0;
}

.split-layout .form-panel {
    flex: 0 0 480px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--gw-spacing-xl);
    background: #0f0f23;
    overflow-y: auto;
    position: relative;
}

[data-theme="light"] .split-layout .form-panel {
    background: #f5f5f5;
}

.form-panel-footer {
    position: absolute;
    bottom: var(--gw-spacing-lg);
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.75rem;
    color: #999;
}

.form-panel-footer a {
    color: #666;
    text-decoration: none;
}

.form-panel-footer a:hover {
    color: var(--gw-accent-color);
    text-decoration: underline;
}

/* Split layout directions */
.split-layout.split-left .brand-panel {
    order: 1;
}

.split-layout.split-left .form-panel {
    order: 2;
}

.split-layout.split-right .brand-panel {
    order: 2;
}

.split-layout.split-right .form-panel {
    order: 1;
}

/* ============================================
   BRAND PANEL CONTENT
   ============================================ */
.brand-content {
    text-align: left;
    position: relative;
    z-index: 3;
    max-width: 500px;
    padding: var(--gw-spacing-xl);
}

.brand-logo {
    margin-bottom: var(--gw-spacing-xl);
}

.brand-logo img {
    max-width: 160px;
    max-height: 60px;
    object-fit: contain;
}

.brand-icon {
    margin-bottom: var(--gw-spacing-xl);
}

.brand-icon i {
    font-size: 3rem;
    color: var(--gw-accent-color);
}

.brand-title {
    font-size: 2.5rem;
    color: var(--gw-title-color);
    line-height: 1.2;
    margin-bottom: var(--gw-spacing-md);
    font-weight: 600;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.brand-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--gw-accent-color), rgba(var(--gw-accent-rgb), 0.3));
    margin-top: var(--gw-spacing-md);
    border-radius: 2px;
}

.brand-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 400px;
    margin-top: var(--gw-spacing-sm);
}

/* ============================================
   FEATURE IMAGE
   ============================================ */
.feature-image {
    position: absolute;
    right: -120px;
    top: 50%;
    transform: translateY(-50%);
    width: 450px;
    height: 450px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid rgba(var(--gw-accent-rgb), 0.4);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 80px rgba(var(--gw-accent-rgb), 0.15),
        inset 0 0 30px rgba(0, 0, 0, 0.1);
    z-index: 4;
}

.feature-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.feature-image:hover img {
    transform: scale(1.05);
}

/* ============================================
   FORM CONTAINER
   ============================================ */
.form-container {
    width: 100%;
    max-width: 380px;
    padding: 2.5rem var(--gw-spacing-xl);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--gw-radius-lg);
    box-shadow: var(--gw-shadow-md);
}

[data-theme="light"] .form-container {
    background: #ffffff;
    border-color: #e0e0e0;
}

.form-container .login-logo {
    text-align: center;
    margin-bottom: var(--gw-spacing-lg);
}

.form-container .login-logo img {
    max-width: 60px;
    max-height: 60px;
    object-fit: contain;
}

.form-container .page-icon {
    text-align: center;
    margin-bottom: var(--gw-spacing-md);
}

.form-container .page-icon i {
    font-size: 2.5rem;
    color: var(--gw-accent-color);
}

.form-title {
    font-size: 1.5rem;
    color: #ffffff;
    text-align: center;
    margin-bottom: var(--gw-spacing-sm);
    font-weight: 600;
}

[data-theme="light"] .form-title {
    color: #1a1a1a;
}

.form-subtitle {
    color: #999999;
    text-align: center;
    margin-bottom: var(--gw-spacing-xl);
    font-size: 0.95rem;
    line-height: 1.5;
}

[data-theme="light"] .form-subtitle {
    color: #666666;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.input-group {
    margin-bottom: 1.25rem;
}

.input-group label {
    display: block;
    margin-bottom: var(--gw-spacing-sm);
    color: #cccccc;
    font-size: 0.875rem;
    font-weight: 500;
}

[data-theme="light"] .input-group label {
    color: #333333;
}

.input-group input {
    width: 100%;
    padding: 0.875rem var(--gw-spacing-md);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--gw-radius-md);
    background: rgba(0, 0, 0, 0.2);
    color: #ffffff;
    font-size: 1rem;
    transition: all var(--gw-transition-normal);
    font-family: inherit;
}

[data-theme="light"] .input-group input {
    background: #ffffff;
    border-color: #d0d0d0;
    color: #1a1a1a;
}

.input-group input:focus {
    border-color: var(--gw-accent-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--gw-accent-rgb), 0.15);
}

.input-group input::placeholder {
    color: var(--gw-text-muted);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: var(--gw-spacing-sm);
    margin-bottom: 1.25rem;
}

.checkbox-group input {
    width: 16px;
    height: 16px;
    accent-color: var(--gw-accent-color);
    cursor: pointer;
}

.checkbox-group label {
    cursor: pointer;
    font-size: 0.85rem;
    color: #999999;
}

[data-theme="light"] .checkbox-group label {
    color: #555555;
}

/* ============================================
   SUBMIT BUTTON
   ============================================ */
.submit-btn {
    width: 100%;
    padding: var(--gw-spacing-md) var(--gw-spacing-lg);
    background: var(--gw-btn-primary-bg);
    border: 1px solid var(--gw-btn-primary-border);
    border-radius: var(--gw-radius-md);
    color: var(--gw-btn-primary-text);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--gw-transition-normal);
    box-shadow: var(--gw-shadow-sm);
    font-family: inherit;
}

.submit-btn:hover {
    background: var(--gw-btn-primary-hover-bg);
    transform: translateY(-1px);
    box-shadow: var(--gw-shadow-md);
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding: 0.875rem var(--gw-spacing-md);
    border-radius: var(--gw-radius-md);
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    text-align: center;
}

.alert-warning {
    background: rgba(var(--gw-warning-rgb), 0.15);
    border: 1px solid rgba(var(--gw-warning-rgb), 0.3);
    color: #856404;
}

[data-theme="dark"] .alert-warning {
    color: var(--gw-warning-color);
}

.alert-danger {
    background: rgba(var(--gw-danger-rgb), 0.1);
    border: 1px solid rgba(var(--gw-danger-rgb), 0.3);
    color: #721c24;
}

[data-theme="dark"] .alert-danger {
    color: var(--gw-danger-color);
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Large screens - text to left, image attached to right edge */
@media (max-width: 1550px) {
    .split-layout .brand-panel {
        justify-content: flex-start;
        padding-left: 3rem;
    }

    .feature-image {
        width: 340px;
        height: 340px;
        right: -100px;
        /* Extend past panel edge to stay attached to right */
    }

    .brand-content {
        max-width: 380px;
        padding-right: 1rem;
    }
}

/* Medium-large screens */
@media (max-width: 1300px) {
    .split-layout .brand-panel {
        padding-left: 2rem;
    }

    .feature-image {
        width: 280px;
        height: 280px;
        right: -80px;
    }

    .brand-content {
        max-width: 320px;
    }

    .brand-title {
        font-size: 2rem;
    }

    .brand-subtitle {
        font-size: 0.95rem;
    }
}

/* Medium screens - narrower form panel */
@media (max-width: 1150px) {
    .split-layout .form-panel {
        flex: 0 0 420px;
    }

    .feature-image {
        width: 240px;
        height: 240px;
        right: -60px;
    }

    .brand-content {
        max-width: 280px;
    }

    .brand-title {
        font-size: 1.8rem;
    }
}

/* Small-medium screens - even narrower */
@media (max-width: 1050px) {
    .split-layout .form-panel {
        flex: 0 0 400px;
    }

    .feature-image {
        width: 200px;
        height: 200px;
        right: -50px;
    }

    .brand-content {
        max-width: 240px;
        padding: var(--gw-spacing-sm);
    }

    .brand-title {
        font-size: 1.6rem;
    }

    .brand-subtitle {
        font-size: 0.9rem;
    }
}

/* Narrow screens - smaller image, keep visible */
@media (max-width: 950px) {
    .feature-image {
        width: 160px;
        height: 160px;
        right: -40px;
    }

    .brand-content {
        max-width: 200px;
        padding: var(--gw-spacing-xs);
    }

    .brand-title {
        font-size: 1.4rem;
    }

    .brand-subtitle {
        font-size: 0.85rem;
    }

    .split-layout .form-panel {
        flex: 0 0 380px;
    }
}

/* Tablet/small screens - stacked layout */
@media (max-width: 900px) {
    .login-page {
        height: auto;
        min-height: 100vh;
        max-height: none;
        overflow: auto;
    }

    .split-layout {
        flex-direction: column;
    }

    .split-layout .brand-panel {
        flex: none;
        min-height: 280px;
        padding: var(--gw-spacing-xl);
        position: relative;
    }

    /* Hide decorative arcs on mobile to prevent overlap with form */
    .split-layout .brand-panel::before,
    .split-layout .brand-panel::after,
    .brand-content::before,
    .brand-content::after {
        display: none;
    }

    .split-layout .form-panel {
        flex: 1;
        padding: var(--gw-spacing-lg);
        overflow: visible;
        position: relative;
        z-index: 10;
    }

    .split-layout.split-left .brand-panel,
    .split-layout.split-right .brand-panel {
        order: 1;
    }

    .split-layout.split-left .form-panel,
    .split-layout.split-right .form-panel {
        order: 2;
    }

    /* Image positioned on right edge in stacked layout */
    .feature-image {
        display: block;
        position: absolute;
        right: -40px;
        /* Extend past panel to attach to right edge */
        top: 50%;
        transform: translateY(-50%);
        width: 180px;
        height: 180px;
        margin-top: 0;
    }

    .brand-content {
        max-width: 60%;
        text-align: left;
    }

    .brand-title {
        font-size: 1.8rem;
    }

    .brand-title::after {
        margin-left: 0;
        margin-right: auto;
    }

    .form-container {
        max-width: 100%;
        padding: var(--gw-spacing-lg);
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
        border-radius: var(--gw-radius-lg) var(--gw-radius-lg) 0 0;
        margin-top: -1rem;
    }
}

/* ============================================
   MINIMAL SIGN OUT CARD (used when navbar hidden)
   Uses theme variables for consistent theming
   ============================================ */

/* Wrapper to center the card on page */
.logout-minimal-wrapper,
.signout-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px);
    padding: 40px 20px;
    box-sizing: border-box;
}

/* Minimal sign out card */
.logout-card-minimal,
.signout-card {
    background: var(--gw-surface-color);
    border: 1px solid var(--gw-surface-border);
    border-radius: var(--gw-radius-lg);
    padding: 40px 48px;
    text-align: center;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--gw-shadow-md);
}

/* Sign out header - icon and title side by side */
.logout-card-minimal .logout-header,
.signout-card .signout-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.logout-card-minimal .logout-header i,
.signout-card .signout-header i {
    font-size: 1.75rem;
    color: var(--gw-accent-color);
}

.logout-card-minimal .logout-header h1,
.signout-card .signout-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gw-title-color);
    margin: 0;
}

/* Sign out message */
.logout-card-minimal .logout-message,
.signout-card .signout-message {
    font-size: 16px;
    color: var(--gw-text-muted);
    margin: 0 0 24px 0;
    line-height: 1.5;
}

/* Sign out actions - buttons side by side */
.logout-card-minimal .logout-actions,
.signout-card .signout-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
}

/* Make form inline so buttons sit side by side */
.logout-form-inline,
.signout-form-inline {
    display: inline-block;
    margin: 0;
    padding: 0;
}

.logout-card-minimal .logout-actions .btn,
.signout-card .signout-actions .btn {
    min-width: 100px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--gw-radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all var(--gw-transition-normal);
    text-decoration: none;
}

.logout-card-minimal .logout-actions .btn-primary,
.signout-card .signout-actions .btn-primary {
    background: var(--gw-btn-primary-bg);
    color: var(--gw-btn-primary-text);
    border: 1px solid var(--gw-btn-primary-border);
}

.logout-card-minimal .logout-actions .btn-primary:hover,
.signout-card .signout-actions .btn-primary:hover {
    background: var(--gw-btn-primary-hover-bg);
}

.logout-card-minimal .logout-actions .btn-secondary,
.signout-card .signout-actions .btn-secondary {
    background: var(--gw-btn-bg);
    color: var(--gw-btn-text);
    border: 1px solid var(--gw-btn-border);
}

.logout-card-minimal .logout-actions .btn-secondary:hover,
.signout-card .signout-actions .btn-secondary:hover {
    background: var(--gw-btn-hover-bg);
    color: var(--gw-btn-hover-text);
    border-color: var(--gw-btn-hover-border);
}

/* ============================================
   LIGHT MODE EXPLICIT OVERRIDES
   Ensures text visibility on light backgrounds
   ============================================ */
[data-theme="light"] .logout-card-minimal .logout-header h1,
[data-theme="light"] .signout-card .signout-header h1 {
    color: #1a1a1a;
}

[data-theme="light"] .logout-card-minimal .logout-header i,
[data-theme="light"] .signout-card .signout-header i {
    color: #16a34a;
}

[data-theme="light"] .logout-card-minimal .logout-message,
[data-theme="light"] .signout-card .signout-message {
    color: #555555;
}

[data-theme="light"] .logout-card-minimal,
[data-theme="light"] .signout-card {
    background: #ffffff;
    border-color: #e0e0e0;
}

[data-theme="light"] .logout-card-minimal .logout-actions .btn-secondary,
[data-theme="light"] .signout-card .signout-actions .btn-secondary {
    background: #f5f5f5;
    color: #333333;
    border-color: #d0d0d0;
}

[data-theme="light"] .logout-card-minimal .logout-actions .btn-secondary:hover,
[data-theme="light"] .signout-card .signout-actions .btn-secondary:hover {
    background: #eeeeee;
    color: #16a34a;
    border-color: #16a34a;
}