/*
==================================================
SPLIT SCREEN LOGIN DESIGN - SISTEMA ESCOLAR SAS
Layout moderno com carrossel de imagens lateral
==================================================
*/

/* Variables CSS */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #ffffff;
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --border-radius: 16px;
    --border-radius-lg: 24px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Reset e base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.split-login {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    background: #f8fafc;
}

/* Container principal split */
.split-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* =====================================
   LADO ESQUERDO - CARROSSEL E ANIMAÇÕES
   ===================================== */
.split-left {
    flex: 1;
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Background animado moderno */
.animated-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

/* Ondas geométricas */
.wave-layer {
    position: absolute;
    width: 120%;
    height: 120%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><defs><linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%"><stop offset="0%" style="stop-color:rgba(255,255,255,0.1);stop-opacity:1" /><stop offset="100%" style="stop-color:rgba(255,255,255,0.05);stop-opacity:1" /></linearGradient></defs><path d="M0 10 Q25 0 50 10 T100 10 V20 H0 Z" fill="url(%23grad1)"/></svg>') repeat-x;
    animation: wave 8s linear infinite;
}

.wave-layer:nth-child(1) {
    top: 10%;
    animation-duration: 8s;
    opacity: 0.7;
}

.wave-layer:nth-child(2) {
    top: 50%;
    animation-duration: 12s;
    animation-direction: reverse;
    opacity: 0.5;
}

.wave-layer:nth-child(3) {
    bottom: 10%;
    animation-duration: 15s;
    opacity: 0.3;
}

@keyframes wave {
    0% { transform: translateX(-100px); }
    100% { transform: translateX(100px); }
}

/* Partículas flutuantes */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.particle:nth-child(1) {
    width: 20px;
    height: 20px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
    animation-duration: 8s;
}

.particle:nth-child(2) {
    width: 15px;
    height: 15px;
    top: 60%;
    left: 80%;
    animation-delay: 2s;
    animation-duration: 10s;
}

.particle:nth-child(3) {
    width: 25px;
    height: 25px;
    top: 80%;
    left: 20%;
    animation-delay: 4s;
    animation-duration: 12s;
}

.particle:nth-child(4) {
    width: 18px;
    height: 18px;
    top: 30%;
    left: 70%;
    animation-delay: 1s;
    animation-duration: 9s;
}

.particle:nth-child(5) {
    width: 22px;
    height: 22px;
    top: 70%;
    left: 60%;
    animation-delay: 3s;
    animation-duration: 11s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-30px) rotate(180deg);
        opacity: 1;
    }
}

/* Mesh gradient animado */
.mesh-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    animation: meshMove 20s ease-in-out infinite;
    z-index: 1;
}

@keyframes meshMove {
    0%, 100% {
        background-position: 0% 0%, 100% 100%, 50% 50%;
        opacity: 1;
    }
    33% {
        background-position: 100% 0%, 0% 100%, 20% 80%;
        opacity: 0.8;
    }
    66% {
        background-position: 0% 100%, 100% 0%, 80% 20%;
        opacity: 0.9;
    }
}

/* Conteúdo do lado esquerdo */
.left-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: white;
    max-width: 500px;
    padding: 2rem;
}

/* Logo animado */
.brand-logo {
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.5s forwards;
}

.brand-logo img {
    max-width: 200px;
    height: auto;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.brand-logo img:hover {
    transform: scale(1.05) rotate(2deg);
}

/* Título principal */
.brand-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #ffffff, #f0f9ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.1);
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.7s forwards;
}

.brand-subtitle {
    font-size: 1.2rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 3rem;
    line-height: 1.6;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.9s forwards;
}

/* Features list */
.features-list {
    list-style: none;
    text-align: left;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 1.1s forwards;
}

.feature-item {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

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

.feature-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.5rem;
}

.feature-text {
    flex: 1;
}

.feature-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.feature-desc {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

/* =====================================
   LADO DIREITO - FORMULÁRIO
   ===================================== */
.split-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #ffffff;
    position: relative;
}

/* Form container */
.form-container {
    width: 100%;
    max-width: 420px;
    padding: 3rem 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    opacity: 0;
    animation: slideInRight 0.8s ease-out 0.3s forwards;
}

/* Header do formulário */
.form-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.form-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
}

/* Form groups */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.1rem;
    z-index: 2;
    transition: color 0.3s ease;
}

.form-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.form-input:focus + .input-icon {
    color: var(--primary-color);
}

.form-input::placeholder {
    color: var(--text-secondary);
    font-weight: 400;
}

/* Password toggle */
.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.3s ease;
    z-index: 2;
}

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

/* Checkbox customizado */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    cursor: pointer;
}

.checkbox {
    position: relative;
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
}

.checkbox input {
    opacity: 0;
    position: absolute;
    cursor: pointer;
}

.checkbox-custom {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.checkbox input:checked ~ .checkbox-custom {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-custom:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox input:checked ~ .checkbox-custom:after {
    display: block;
}

.checkbox-label {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    user-select: none;
}

/* Botões modernos */
.btn {
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    text-transform: none;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--text-light);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: var(--text-light);
    box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

/* Links */
.form-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.form-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.form-link:hover {
    color: var(--secondary-color);
    text-decoration: none;
}

.form-link:hover::after {
    width: 100%;
}

/* Footer do form */
.form-footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Footer com marca da empresa */
.company-footer {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    font-weight: 500;
}

.company-footer .company-name {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.company-footer .company-name:hover {
    color: rgba(255, 255, 255, 1);
    text-decoration: none;
}

/* Alertas */
.alert {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #dc2626;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    animation: alertSlide 0.3s ease-out;
}

.alert i {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

/* Animações */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Responsividade - Formulário Primeiro Abaixo de 1000px */
@media (max-width: 1000px) {
    .split-container {
        flex-direction: row-reverse; /* Formulário primeiro */
        height: 100vh;
    }

    .split-left {
        flex: 0.4; /* 40% da tela em tablet */
        padding: 1.5rem 1rem;
        min-height: 100vh;
    }

    .split-right {
        flex: 0.6; /* 60% da tela em tablet */
        padding: 1.5rem 1rem;
        min-height: 100vh;
    }

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

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

    .left-content {
        max-width: 100%;
    }

    .features-list {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .feature-item {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }

    .feature-title {
        font-size: 0.9rem;
    }

    .feature-desc {
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    .split-container {
        flex-direction: row-reverse; /* Formulário primeiro */
        height: 100vh;
    }

    .split-left {
        flex: 0.45; /* 45% da tela em mobile */
        padding: 1rem 0.75rem;
        min-height: 100vh;
    }

    .split-right {
        flex: 0.55; /* 55% da tela em mobile */
        padding: 1rem 0.75rem;
        min-height: 100vh;
    }

    .brand-title {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .brand-subtitle {
        font-size: 0.8rem;
        margin-bottom: 1.5rem;
    }

    .brand-logo img {
        max-width: 120px;
    }

    .form-container {
        padding: 1.5rem 1rem;
        margin: 0.5rem;
        max-width: 100%;
    }

    .form-title {
        font-size: 1.5rem;
    }

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

    .features-list {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .feature-item {
        padding: 0.5rem;
        margin-bottom: 0.25rem;
    }

    .feature-icon {
        width: 35px;
        height: 35px;
        margin-right: 0.75rem;
        font-size: 1.2rem;
    }

    .feature-title {
        font-size: 0.8rem;
        margin-bottom: 0.125rem;
    }

    .feature-desc {
        font-size: 0.7rem;
        line-height: 1.2;
    }
}

@media (max-width: 480px) {
    .split-container {
        height: 100vh;
        flex-direction: row-reverse; /* Formulário primeiro */
    }

    .split-left {
        flex: 0.4; /* 40% em telas muito pequenas */
        padding: 0.75rem 0.5rem;
    }

    .split-right {
        flex: 0.6; /* 60% em telas muito pequenas */
        padding: 0.75rem 0.5rem;
    }

    .brand-title {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }

    .brand-subtitle {
        font-size: 0.7rem;
        margin-bottom: 1rem;
    }

    .brand-logo img {
        max-width: 100px;
    }

    .form-container {
        padding: 1rem 0.75rem;
        margin: 0.25rem;
    }

    .form-title {
        font-size: 1.25rem;
    }

    .form-subtitle {
        font-size: 0.8rem;
    }

    .form-input {
        padding: 0.75rem 0.75rem 0.75rem 2.25rem;
        font-size: 0.85rem;
    }

    .input-icon {
        left: 0.65rem;
        font-size: 0.9rem;
    }

    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }

    .features-list {
        gap: 0.25rem;
    }

    .feature-item {
        padding: 0.4rem;
        flex-direction: column;
        text-align: center;
    }

    .feature-icon {
        width: 30px;
        height: 30px;
        margin: 0 auto 0.25rem;
        font-size: 1rem;
    }

    .feature-title {
        font-size: 0.7rem;
        margin-bottom: 0;
    }

    .feature-desc {
        display: none; /* Oculta descrição em telas muito pequenas */
    }
}


/* MOBILE FIXES - LOGO E LAYOUT */
@media (max-width: 768px) {
    .split-left .left-content {
        padding: 0.5rem 0.2rem !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
        height: 100% !important;
    }

    .split-left .brand-logo {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        margin-bottom: 0.5rem !important;
    }

    .split-left .brand-logo img {
        max-width: 70px !important;
        width: auto !important;
        height: auto !important;
        display: block !important;
    }

    .split-left .brand-title {
        font-size: 0.9rem !important;
        margin: 0.3rem 0 !important;
        padding: 0 !important;
        line-height: 1.2 !important;
    }

    .split-left .brand-subtitle {
        font-size: 0.6rem !important;
        margin: 0.3rem 0 !important;
        padding: 0 !important;
        line-height: 1.1 !important;
    }

    .split-left .features-list {
        margin: 0 !important;
        padding: 0 !important;
        gap: 0.3rem !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .split-left .feature-item {
        width: 100% !important;
        max-width: 80px !important;
        padding: 0.2rem !important;
        text-align: center !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .split-left .feature-icon {
        width: 20px !important;
        height: 20px !important;
        font-size: 0.8rem !important;
        margin: 0 auto 0.2rem !important;
    }

    .split-left .feature-title {
        font-size: 0.55rem !important;
        margin: 0 !important;
        line-height: 1 !important;
    }

    .split-left .feature-desc {
        display: none !important;
    }

    .split-left .company-footer {
        font-size: 0.5rem !important;
        margin-top: 0.5rem !important;
        text-align: center !important;
    }
}

/* Ajustes específicos para manter usabilidade em mobile */
@media (max-width: 375px) {
    .split-left {
        flex: 0.35;
    }

    .split-right {
        flex: 0.65;
    }

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

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

    .feature-title {
        font-size: 0.65rem;
    }

    .company-footer {
        font-size: 0.6rem;
        bottom: 0.5rem;
    }
}

/* Loader */
.split-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 50%, var(--accent-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loader-content {
    text-align: center;
    color: white;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}