/* ==========================================================================
   Login Split Screen - Modern Design
   ========================================================================== */

/* CSS Custom Properties */
:root {
    --primary: #0891b2;
    --primary-dark: #0e7490;
    --primary-light: #22d3ee;
    --secondary: #f0fdfa;
    --accent: #14b8a6;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --transition: 200ms ease;
}

/* Reset for login page */
.login-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ==========================================================================
   Split Screen Layout
   ========================================================================== */

.login-split {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Left Side - Hero/Image */
.login-hero {
    flex: 1;
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 50%, #115e59 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.login-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='50' cy='50' r='40' fill='none' stroke='%23ffffff' stroke-width='0.5' stroke-opacity='0.1'/%3E%3Ccircle cx='50' cy='50' r='25' fill='none' stroke='%23ffffff' stroke-width='0.5' stroke-opacity='0.1'/%3E%3Ccircle cx='50' cy='50' r='10' fill='none' stroke='%23ffffff' stroke-width='0.5' stroke-opacity='0.1'/%3E%3C/svg%3E");
    background-size: 100px 100px;
    opacity: 0.5;
}

.login-hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--white);
    max-width: 480px;
}

.login-hero-logo {
    width: 200px;
    height: auto;
    margin-bottom: 2rem;
    filter: brightness(0) invert(1);
}

.login-hero-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.login-hero-subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.login-hero-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

.login-hero-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.login-hero-feature i {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* Water wave decoration */
.login-hero-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%23ffffff' fill-opacity='0.1' d='M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,154.7C960,171,1056,181,1152,165.3C1248,149,1344,107,1392,85.3L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'%3E%3C/path%3E%3C/svg%3E");
    background-size: cover;
    background-repeat: no-repeat;
}

/* Right Side - Form */
.login-form-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: var(--white);
    position: relative;
}

.login-form-container {
    width: 100%;
    max-width: 450px;
    padding: 1rem;
}

.login-form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-form-logo {
    display: none;
}

.login-form-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.login-form-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ==========================================================================
   Form Elements
   ========================================================================== */

.login-input-group {
    position: relative;
    margin-bottom: 1.25rem;
}

.login-input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.login-input-wrapper {
    position: relative;
}

.login-input-wrapper .form-control,
.login-input-wrapper input[type="text"],
.login-input-wrapper input[type="password"] {
    width: 100%;
    height: 48px;
    padding: 0 1rem 0 3rem;
    font-size: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--gray-50);
    color: var(--text-dark);
    transition: all var(--transition);
    box-sizing: border-box;
}

.login-input-wrapper .form-control:focus,
.login-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.1);
}

.login-input-wrapper .form-control::placeholder {
    color: var(--text-light);
}

.login-input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1.125rem;
    pointer-events: none;
    transition: color var(--transition);
}

.login-input-wrapper:focus-within .login-input-icon {
    color: var(--primary);
}

/* Password toggle */
.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.125rem;
    transition: color var(--transition);
}

.password-toggle:hover {
    color: var(--primary);
}

/* ==========================================================================
   Buttons - Base Styles
   ========================================================================== */

/* Button row layout */
.login-btn-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1rem !important;
    margin-top: 1.5rem;
    width: 100% !important;
}

/* Container around button row */
.login-btn-row-container {
    margin-top: 1.5rem;
}

/* Make sure buttons fill their grid cell */
.login-btn-row > a,
.login-btn-row > .btn,
.login-btn-row > span > a,
.login-btn-row > span > .btn {
    min-width: 0 !important;
    text-align: center !important;
    box-sizing: border-box !important;
}

/* Force grid items to not shrink below content */
.login-btn-row > * {
    min-width: 0 !important;
}

/* ==========================================================================
   PrimeFaces Button Overrides - FORCING CORRECT COLORS
   ========================================================================== */

/* Primary Button - AZUL */
.btn-primary,
.btn-primary:link,
.btn-primary:visited,
.btn-primary:hover,
.btn-primary:active,
.btn-primary:focus,
a.btn-primary,
a.btn-primary:link,
a.btn-primary:visited,
a.btn-primary:hover,
a.btn-primary:active,
a.btn-primary:focus {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%) !important;
    background-color: #0891b2 !important;
    color: #ffffff !important;
    border: none !important;
    border-color: transparent !important;
    height: 48px !important;
    padding: 0 1.5rem !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 14px rgba(8, 145, 178, 0.35) !important;
    transition: all 200ms ease !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.btn-primary:hover,
a.btn-primary:hover {
    background: linear-gradient(135deg, #0e7490 0%, #115e59 100%) !important;
    background-color: #0e7490 !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(8, 145, 178, 0.45) !important;
}

.btn-primary:active,
a.btn-primary:active {
    transform: translateY(0);
}

/* Success Button - VERDE */
.btn-success,
.btn-success:link,
.btn-success:visited,
.btn-success:hover,
.btn-success:active,
.btn-success:focus,
a.btn-success,
a.btn-success:link,
a.btn-success:visited,
a.btn-success:hover,
a.btn-success:active,
a.btn-success:focus {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    background-color: #10b981 !important;
    color: #ffffff !important;
    border: none !important;
    border-color: transparent !important;
    height: 48px !important;
    padding: 0 1.5rem !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35) !important;
    transition: all 200ms ease !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.btn-success:hover,
a.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    background-color: #059669 !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45) !important;
}

.btn-success:active,
a.btn-success:active {
    transform: translateY(0);
}

/* Warning Button - LARANJA */
.btn-warning,
.btn-warning:link,
.btn-warning:visited,
.btn-warning:hover,
.btn-warning:active,
.btn-warning:focus,
a.btn-warning,
a.btn-warning:link,
a.btn-warning:visited,
a.btn-warning:hover,
a.btn-warning:active,
a.btn-warning:focus {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    background-color: #f59e0b !important;
    color: #ffffff !important;
    border: none !important;
    border-color: transparent !important;
    height: 48px !important;
    padding: 0 1.5rem !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35) !important;
    transition: all 200ms ease !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.btn-warning:hover,
a.btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
    background-color: #d97706 !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45) !important;
}

.btn-warning:active,
a.btn-warning:active {
    transform: translateY(0);
}

/* Default Button - CINZA */
.btn-default,
.btn-default:link,
.btn-default:visited,
.btn-default:hover,
.btn-default:active,
.btn-default:focus,
a.btn-default,
a.btn-default:link,
a.btn-default:visited,
a.btn-default:hover,
a.btn-default:active,
a.btn-default:focus {
    background: #f1f5f9 !important;
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    border: 2px solid #e2e8f0 !important;
    border-color: #e2e8f0 !important;
    height: 48px !important;
    padding: 0 1.5rem !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    border-radius: 12px !important;
    transition: all 200ms ease !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;
}

.btn-default:hover,
a.btn-default:hover {
    background: #e2e8f0 !important;
    background-color: #e2e8f0 !important;
    color: #0891b2 !important;
    border-color: #0891b2 !important;
    transform: none;
}

/* Block button utility */
.btn-block {
    display: flex !important;
    width: 100% !important;
}

/* Button text inside */
.btn-primary .ui-button-text,
.btn-success .ui-button-text,
.btn-warning .ui-button-text {
    color: #ffffff !important;
}

.btn-default .ui-button-text {
    color: #0f172a !important;
}

/* Icon colors inside buttons */
.btn-primary .ui-icon,
.btn-success .ui-icon,
.btn-warning .ui-icon,
.btn-primary i,
.btn-success i,
.btn-warning i {
    color: #ffffff !important;
}

/* Fix for PrimeFaces commandLink styled as button */
a.btn {
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

a.btn span {
    color: inherit !important;
}

/* PrimeFaces commandLink specific fixes */
.login-btn-row a.btn {
    display: flex !important;
    flex: 1 !important;
    min-width: 0 !important;
}

/* Ensure icons don't break layout */
.login-btn-row a.btn i {
    flex-shrink: 0 !important;
    margin-right: 0.5rem !important;
}

/* Form control override */
.form-control {
    height: 48px !important;
    padding: 0 1rem 0 3rem !important;
    font-size: 1rem !important;
    border: 2px solid var(--gray-200) !important;
    border-radius: var(--radius-md) !important;
    background: var(--gray-50) !important;
    transition: all var(--transition) !important;
}

.form-control:focus {
    border-color: var(--primary) !important;
    background: var(--white) !important;
    box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.1) !important;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.login-footer {
    background: var(--gray-50);
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--gray-200);
}

.login-footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.login-footer-column h4 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.login-footer-column p,
.login-footer-column address {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
    font-style: normal;
    margin: 0;
}

.login-footer-column a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

.login-footer-column a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.login-footer-social {
    display: flex;
    gap: 0.75rem;
}

.login-footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 1rem;
    transition: all var(--transition);
}

.login-footer-social a:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    text-decoration: none;
}

.login-footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
    font-size: 0.8rem;
    color: var(--text-light);
}

/* ==========================================================================
   Utility
   ========================================================================== */

.login-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-light);
    font-size: 0.875rem;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

.login-divider span {
    padding: 0 1rem;
}

.login-back-link {
    text-align: center;
    margin-top: 1.5rem;
}

.login-back-link a {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color var(--transition);
}

.login-back-link a:hover {
    color: var(--primary);
}

.login-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--danger);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Growl override */
.ui-growl {
    top: 20px !important;
    right: 20px !important;
    z-index: 10000 !important;
}

.ui-growl-item-container {
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-lg) !important;
    border: none !important;
}

/* Modal override */
.modal-content {
    border-radius: var(--radius-lg) !important;
    border: none !important;
    box-shadow: var(--shadow-xl) !important;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    .login-hero {
        padding: 2rem;
    }
    
    .login-hero-title {
        font-size: 1.5rem;
    }
    
    .login-hero-subtitle {
        font-size: 1rem;
    }
    
    .login-footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .login-split {
        flex-direction: column;
    }
    
    .login-hero {
        min-height: auto;
        padding: 2rem 1.5rem;
    }
    
    .login-hero-logo {
        width: 140px;
        margin-bottom: 1rem;
    }
    
    .login-hero-title {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }
    
    .login-hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .login-hero-features {
        display: none;
    }
    
    .login-hero-wave {
        display: none;
    }
    
    .login-form-side {
        padding: 1.5rem;
        flex: 1;
    }
    
    .login-form-logo {
        display: block;
        width: 120px;
        margin: 0 auto 1.5rem;
    }
    
    .login-form-title {
        font-size: 1.5rem;
    }
    
    .login-footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
    
    .login-footer-social {
        justify-content: center;
    }
    
    .login-btn-row {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) {
    .login-hero {
        position: sticky;
        top: 0;
        height: 100vh;
    }
}
