@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap');

:root {
    --ftm-navy: #0f3b60;
    --ftm-navy-light: #1e40af;
    --ftm-orange: #f97316;
    --ftm-orange-hover: #ea580c;
    --ftm-blue: #0284c7;
    --ftm-bg: #e2e8f0;
    --ftm-slate-panel: #f8fafc;
    --ftm-text-main: #0f172a;
    --ftm-text-muted: #64748b;
    --ftm-border: #cbd5e1;
    --ftm-border-focus: #0284c7;
    --ftm-success: #10b981;
    --ftm-danger: #ef4444;
    --ftm-radius-sm: 8px;
    --ftm-radius-md: 16px;
    --ftm-radius-lg: 20px;
}

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

/* Opción 3: Tono Perla Slate con Fondo de Contraste Suave */
body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #e2e8f0;
    color: var(--ftm-text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    background-image:
        radial-gradient(at 0% 0%, rgba(2, 132, 199, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(249, 115, 22, 0.12) 0px, transparent 50%),
        radial-gradient(at 80% 15%, rgba(15, 59, 96, 0.08) 0px, transparent 50%),
        radial-gradient(at 20% 85%, rgba(203, 213, 225, 0.6) 0px, transparent 60%);
    background-attachment: fixed;
}

h1,
h2,
h3,
h4,
.brand-title {
    font-family: 'Outfit', sans-serif;
}

/* Auth Page Container */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 1rem;
}

.auth-container {
    width: 100%;
    max-width: 950px;
    background: #ffffff;
    border-radius: var(--ftm-radius-lg);
    box-shadow:
        0 20px 45px -10px rgba(15, 23, 42, 0.12),
        0 4px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid #cbd5e1;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    overflow: hidden;
    position: relative;
}

/* Left Brand Panel */
.auth-brand-panel {
    background: linear-gradient(150deg, #2d82b7 0%, #0f3b60 100%);
    color: #ffffff;
    padding: 2.25rem 2.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.auth-brand-panel::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.22) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.auth-brand-panel::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -40px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.18) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.brand-header {
    position: relative;
    z-index: 2;
}

.brand-logo-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    margin-bottom: 0.75rem;
}

.brand-logo-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.brand-logo-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.4px;
}

/* La marca del login es la imagen de letras (sin texto) */
.brand-logo-letras {
    display: block;
    width: auto;
    height: 24px;
    object-fit: contain;
}

.brand-hero-title {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 0.35rem;
    color: #ffffff;
}

.brand-hero-title span {
    color: var(--ftm-orange);
}

.brand-hero-desc {
    font-size: 0.85rem;
    color: #cbd5e1;
    line-height: 1.45;
    margin-bottom: 0.6rem;
}

.brand-illustration-container {
    position: relative;
    z-index: 2;
    text-align: center;
    margin: 0.75rem 0;
    background: #ffffff;
    padding: 0.75rem 1rem;
    border-radius: var(--ftm-radius-md);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16);
}

.brand-illustration-img {
    max-width: 100%;
    height: auto;
    max-height: 155px;
    object-fit: contain;
    border-radius: var(--ftm-radius-sm);
    display: block;
    margin: 0 auto;
}

.brand-features-list {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 0.5rem;
}

.brand-feature-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.8rem;
    color: #e2e8f0;
}

.brand-feature-item i {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
}

/* Right Form Panel - Fondo Perla Slate Suave */
.auth-form-panel {
    padding: 2.5rem 2.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: var(--ftm-slate-panel);
    border-left: 1px solid #e2e8f0;
}

.form-header {
    margin-bottom: 1.25rem;
}

.form-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--ftm-navy);
    margin-bottom: 0.25rem;
}

.form-subtitle {
    font-size: 0.85rem;
    color: var(--ftm-text-muted);
}

/* Alert Notices */
.alert-box {
    padding: 0.85rem 1rem;
    border-radius: var(--ftm-radius-sm);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    line-height: 1.4;
}

.alert-success {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Form Controls - Inputs Flotantes en Blanco Puro */
.form-group {
    margin-bottom: 0.95rem;
    position: relative;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.35rem;
}

.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 0.9rem;
    color: #94a3b8;
    font-size: 0.9rem;
    pointer-events: none;
    transition: color 0.2s;
}

.form-input {
    width: 100%;
    padding: 0.65rem 0.85rem 0.65rem 2.45rem;
    font-size: 0.9rem;
    font-family: inherit;
    border: 1.5px solid var(--ftm-border);
    border-radius: var(--ftm-radius-sm);
    background-color: #ffffff;
    color: var(--ftm-text-main);
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.04);
    transition: all 0.2s ease-in-out;
}

.form-input::placeholder {
    color: #94a3b8;
}

.form-input:focus {
    outline: none;
    border-color: var(--ftm-blue);
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.15), 0 3px 8px rgba(0, 0, 0, 0.05);
}

.form-input:focus+.input-icon,
.input-icon-wrapper:focus-within .input-icon {
    color: var(--ftm-blue);
}

.form-input.is-invalid {
    border-color: var(--ftm-danger);
    background-color: #fffbfa;
}

.form-input.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}

.error-text {
    color: var(--ftm-danger);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.password-toggle-btn {
    position: absolute;
    right: 0.65rem;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    border-radius: 4px;
    transition: color 0.2s;
}

.password-toggle-btn:hover {
    color: var(--ftm-navy);
}

/* Options row (remember me & forgot password) */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    font-size: 0.8rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: #475569;
    cursor: pointer;
    user-select: none;
}

.checkbox-input {
    width: 15px;
    height: 15px;
    accent-color: var(--ftm-navy);
    cursor: pointer;
}

.link-custom {
    color: var(--ftm-blue);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.link-custom:hover {
    color: var(--ftm-orange);
    text-decoration: underline;
}

/* Buttons */
.btn-primary-ftm {
    width: 100%;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    color: #ffffff;
    background: linear-gradient(135deg, #2d82b7 0%, #2d82b7 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
    transition: all 0.2s ease-in-out;
}

.btn-primary-ftm:hover {
    background: linear-gradient(135deg, #0369a1 0%, #09253d 100%);
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.4);
    transform: translateY(-1px);
}

.btn-primary-ftm:active {
    transform: translateY(0);
}

.form-footer {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--ftm-text-muted);
}

/* Responsive */
@media (max-width: 900px) {
    .auth-wrapper {
        padding: 1rem 0.75rem;
    }

    .auth-container {
        grid-template-columns: 1fr;
        max-width: 440px;
        border-radius: 18px;
        box-shadow: 0 15px 35px -10px rgba(15, 23, 42, 0.15);
    }

    /* Ocultar elementos pesados en móvil para que el login quede arriba a la vista */
    .brand-illustration-container,
    .brand-features-list,
    .brand-hero-desc {
        display: none !important;
    }

    .auth-brand-panel {
        padding: 1.35rem 1.5rem 1.15rem;
        text-align: center;
        align-items: center;
        border-radius: 18px 18px 0 0;
    }

    .brand-logo-badge {
        margin-bottom: 0.5rem;
    }

    .brand-hero-title {
        font-size: 1.25rem;
        margin-bottom: 0;
        line-height: 1.25;
    }

    .auth-brand-panel::before,
    .auth-brand-panel::after {
        display: none;
    }

    .auth-form-panel {
        padding: 1.6rem 1.6rem 1.85rem;
        border-left: none;
    }

    .form-header {
        margin-bottom: 1rem;
        text-align: center;
    }

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

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

    .alert-box {
        margin-bottom: 1rem;
        padding: 0.65rem 0.85rem;
        font-size: 0.85rem;
    }

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

    /* Altura táctil cómoda e impedir auto-zoom en iOS Safari (>= 16px) */
    .form-input {
        min-height: 48px;
        font-size: 16px !important;
        padding-top: 0.65rem;
        padding-bottom: 0.65rem;
    }

    .input-icon {
        font-size: 1rem;
    }

    .password-toggle-btn {
        min-width: 44px;
        min-height: 44px;
        right: 0.25rem;
    }

    .form-options {
        margin-bottom: 1.25rem;
        font-size: 0.825rem;
        gap: 0.5rem;
    }

    .btn-primary-ftm {
        min-height: 48px;
        font-size: 0.95rem;
        font-weight: 600;
        border-radius: 10px;
    }

    .form-footer {
        margin-top: 1.25rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 420px) {
    .auth-wrapper {
        padding: 0.5rem;
    }

    .auth-container {
        border-radius: 14px;
    }

    .auth-brand-panel {
        padding: 1.15rem 1.25rem 0.95rem;
    }

    .brand-hero-title {
        font-size: 1.15rem;
    }

    .auth-form-panel {
        padding: 1.35rem 1.25rem 1.6rem;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }
}