/**
 * Ciano's Seafood Grill & Bar - Admin Login Page
 * Split-Screen Layout: Orange Left Panel + White Right Panel
 * Brand Colors Only: Orange #FF6200, White, Black
 */

/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body,
.login-body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100vh !important;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    background: #F5F5F5 !important;
    background-color: #F5F5F5 !important;
    background-image: none !important;
    color: #111111 !important;
    overflow-x: hidden !important;
}

/* ============================================
   COLOR VARIABLES - BRAND ONLY
   ============================================ */
:root {
    --cianos-orange: #FF6200;
    --cianos-orange-hover: #E25700;
    --cianos-orange-dark: #d65500;
    --cianos-orange-glow: rgba(255, 98, 0, 0.15);
    --cianos-orange-light: rgba(255, 98, 0, 0.1);
    
    /* Text colors */
    --text-black: #111111;
    --text-white: #FFFFFF;
    --text-gray: #666666;
    --text-light-gray: #999999;
    
    /* Backgrounds */
    --bg-white: #FFFFFF;
    --bg-light: #F5F5F5;
    
    /* Borders */
    --border-light: #DDDDDD;
    --border-medium: #CCCCCC;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    
    /* Error states */
    --error-red: #DC3545;
    --error-red-light: rgba(220, 53, 69, 0.1);
    
    /* Border radius */
    --radius: 12px;
    --radius-sm: 8px;
}

/* ============================================
   MAIN WRAPPER - TWO COLUMN LAYOUT
   ============================================ */
.login-wrapper,
.login-container {
    min-height: 100vh !important;
    height: 100vh !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: row;
    background: #F5F5F5 !important;
    background-color: #F5F5F5 !important;
    background-image: none !important;
    margin: 0;
    padding: 0;
}

/* ============================================
   LEFT PANEL - ORANGE BRANDING (40-45%)
   ============================================ */
.branding-panel,
.login-panel-left {
    flex: 0 0 42% !important;
    background: #FF6200 !important;
    background-color: #FF6200 !important;
    background-image: none !important;
    color: #FFFFFF !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 50px;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 100vh;
}

.branding-content {
    max-width: 520px;
    width: 100%;
    color: #FFFFFF !important;
    z-index: 1;
    position: relative;
}

/* Logo Card - White rounded card on orange */
.logo-container {
    background: #FFFFFF !important;
    width: 140px;
    height: 140px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 40px auto;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.branding-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* Main Title - White text on orange */
.branding-title {
    font-size: 38px;
    font-weight: 700;
    color: #FFFFFF !important;
    margin-bottom: 24px;
    line-height: 1.2;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-align: center;
}

/* Welcome Message - White text on orange */
.branding-welcome {
    font-size: 17px;
    line-height: 1.7;
    color: #FFFFFF !important;
    margin-bottom: 40px;
    font-weight: 400;
    text-align: center;
    opacity: 0.95;
}

/* Feature List - White text with orange icons */
.branding-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.branding-features li {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.6;
    color: #FFFFFF !important;
}

.branding-features li i {
    font-size: 20px;
    color: #FFFFFF !important;
    flex-shrink: 0;
    margin-top: 2px;
}

.branding-features li span {
    flex: 1;
    font-weight: 400;
}

/* ============================================
   RIGHT PANEL - WHITE LOGIN FORM (55-60%)
   ============================================ */
.login-panel,
.login-panel-right {
    flex: 1 !important;
    background: #FFFFFF !important;
    background-color: #FFFFFF !important;
    background-image: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 50px;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 100vh;
}

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

/* Login Panel Title - Black text on white */
.login-panel-title {
    font-size: 26px;
    font-weight: 700;
    color: #111111 !important;
    margin-bottom: 40px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ============================================
   FORM STYLES
   ============================================ */
.login-form {
    width: 100%;
    display: block;
}

.form-group {
    margin-bottom: 24px;
    display: block;
    width: 100%;
}

.form-input-wrapper {
    position: relative;
    display: block;
    width: 100%;
    margin: 0;
}

.form-control {
    width: 100%;
    padding: 15px 18px;
    font-size: 15px;
    border: 2px solid var(--border-light) !important;
    border-radius: var(--radius-sm);
    background: #FFFFFF !important;
    background-color: #FFFFFF !important;
    color: #111111 !important;
    transition: all 0.2s ease;
    outline: none;
    font-family: inherit;
    line-height: 1.5;
    display: block;
    box-sizing: border-box;
}

#username {
    padding-right: 18px;
}

#password {
    padding-right: 50px;
}

.form-control::placeholder {
    color: var(--text-light-gray);
    font-weight: 400;
}

.form-control:hover {
    border-color: var(--border-medium) !important;
}

.form-control:focus {
    border-color: #FF6200 !important;
    background: #FFFFFF !important;
    box-shadow: 0 0 0 4px var(--cianos-orange-glow);
    outline: none;
}

.form-control.is-invalid {
    border-color: var(--error-red) !important;
    background: var(--error-red-light) !important;
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.15);
}

.invalid-feedback {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: var(--error-red);
    font-weight: 500;
    line-height: 1.4;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: all 0.2s ease;
    border-radius: 6px;
    width: 38px;
    height: 38px;
}

.password-toggle:hover {
    color: #FF6200;
    background: var(--cianos-orange-light);
}

.password-toggle:focus-visible {
    outline: 2px solid #FF6200;
    outline-offset: 2px;
}

.password-toggle i {
    font-size: 18px;
}

/* Sign In Button - Orange */
.btn-sign-in {
    width: 100%;
    padding: 17px 24px;
    font-size: 16px;
    font-weight: 700;
    color: #FFFFFF !important;
    background: #FF6200 !important;
    background-color: #FF6200 !important;
    background-image: none !important;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(255, 98, 0, 0.3);
}

.btn-sign-in:hover:not(:disabled) {
    background: #E25700 !important;
    background-color: #E25700 !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 98, 0, 0.4);
}

.btn-sign-in:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 98, 0, 0.3);
}

.btn-sign-in:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Loading Spinner */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spinner 0.7s linear infinite;
}

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

/* Alerts */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-size: 14px;
    border: none;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideDown 0.3s ease-out;
    line-height: 1.5;
}

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

.alert-danger {
    background: var(--error-red-light);
    color: var(--error-red);
    border-left: 4px solid var(--error-red);
}

.alert i {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Error Shake Animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
    20%, 40%, 60%, 80% { transform: translateX(8px); }
}

.login-panel.shake,
.login-panel-right.shake {
    animation: shake 0.4s ease-in-out;
}

/* Footer */
.login-footer {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.login-footer p {
    font-size: 12px;
    color: var(--text-gray);
    margin: 0;
    line-height: 1.5;
    font-weight: 400;
}

/* ============================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ============================================ */
@media (max-width: 768px) {
    /* Stack columns vertically on mobile */
    .login-wrapper,
    .login-container {
        flex-direction: column !important;
        height: auto !important;
        min-height: 100vh;
    }
    
    /* Orange panel on top, full width */
    .branding-panel,
    .login-panel-left {
        flex: 0 0 auto !important;
        width: 100% !important;
        min-height: auto;
        padding: 50px 30px;
        order: 1;
    }
    
    /* White panel below, full width */
    .login-panel,
    .login-panel-right {
        flex: 0 0 auto !important;
        width: 100% !important;
        min-height: auto;
        padding: 50px 30px;
        order: 2;
    }
    
    /* Adjust typography for mobile */
    .logo-container {
        width: 120px;
        height: 120px;
        margin-bottom: 30px;
        padding: 20px;
    }
    
    .branding-title {
        font-size: 28px;
        margin-bottom: 20px;
    }
    
    .branding-welcome {
        font-size: 16px;
        margin-bottom: 30px;
    }
    
    .branding-features li {
        font-size: 15px;
        margin-bottom: 16px;
    }
    
    .login-panel-title {
        font-size: 22px;
        margin-bottom: 32px;
    }
    
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

@media (max-width: 480px) {
    .branding-panel,
    .login-panel-left {
        padding: 40px 24px;
    }
    
    .login-panel,
    .login-panel-right {
        padding: 40px 24px;
    }
    
    .logo-container {
        width: 100px;
        height: 100px;
        margin-bottom: 24px;
        padding: 18px;
    }
    
    .branding-title {
        font-size: 24px;
    }
    
    .branding-welcome {
        font-size: 15px;
    }
    
    .branding-features li {
        font-size: 14px;
    }
    
    .login-panel-title {
        font-size: 20px;
        margin-bottom: 28px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .branding-panel,
    .login-panel-left {
        flex: 0 0 40% !important;
        padding: 50px 40px;
    }
    
    .login-panel,
    .login-panel-right {
        flex: 1 !important;
        padding: 50px 40px;
    }
    
    .branding-title {
        font-size: 32px;
    }
    
    .branding-welcome {
        font-size: 16px;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard navigation */
.form-control:focus-visible,
/* Google Sign-In Divider */
.login-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 25px 0 20px;
    position: relative;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e0e0e0;
}

.login-divider span {
    padding: 0 15px;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    background: var(--bg-white);
}

/* Google Sign-In Button Styling - Centered */
.google-login-section {
    text-align: center;
    margin: 20px 0;
}

.g_id_signin {
    display: block !important;
    margin: 20px auto !important;
    max-width: 300px;
}

.g_id_signin > div {
    margin: 0 auto;
}

/* Google Sign-In Button Container */
#g_id_onload {
    display: none;
}

.btn-sign-in:focus-visible,
.password-toggle:focus-visible {
    outline: 3px solid #FF6200;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .branding-panel,
    .login-panel-left {
        border-right: 2px solid #000000;
    }
    
    .form-control {
        border-width: 3px;
        border-color: #000000;
    }
    
    .form-control:focus {
        border-color: #FF6200;
        outline: 3px solid #FF6200;
    }
    
    .btn-sign-in {
        border: 2px solid #000000;
    }
}

/* Smooth scrolling */
.branding-panel,
.login-panel,
.login-panel-left,
.login-panel-right {
    scroll-behavior: smooth;
}

/* Ensure proper text rendering */
.branding-title,
.login-panel-title {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
