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

:root {
    --primary-red: #c62828;
    --primary-hover: #b71c1c;
    --primary-gradient: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    --accent-gold: #fbc02d;
    --dark-bg: #0f172a;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --input-focus-ring: rgba(211, 47, 47, 0.22);
}

* {
    box-sizing: border-box;
}

body, html {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-main);
    overflow-x: hidden;
}

/* ============================================================
   Page Wrapper & Atmospheric Background
   ============================================================ */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    position: relative;
    background: 
        radial-gradient(circle at 10% 20%, rgba(211, 47, 47, 0.45) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(183, 28, 28, 0.35) 0%, transparent 45%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.94) 0%, rgba(30, 41, 59, 0.92) 100%),
        url('fondo.jpg') center/cover no-repeat fixed;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}

/* ============================================================
   Main Card Layout
   ============================================================ */
.auth-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 980px;
    border-radius: 24px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    flex-wrap: wrap;
    animation: cardAppear 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================================
   Left Brand Section
   ============================================================ */
.auth-brand-pane {
    flex: 1 1 45%;
    min-height: 480px;
    background: linear-gradient(145deg, #b71c1c 0%, #991b1b 50%, #7f1d1d 100%);
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    color: #ffffff;
}

.auth-brand-pane::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.auth-brand-pane::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -60px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(251, 192, 45, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.brand-header-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #fff;
    width: fit-content;
    margin-bottom: 24px;
}

.brand-header-badge .pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #4ade80;
    box-shadow: 0 0 8px #4ade80;
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.brand-logo-box {
    text-align: center;
    margin: 15px 0 25px;
}

.brand-logo-box img {
    max-width: 100%;
    max-height: 150px;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.25));
    transition: transform 0.3s ease;
}

.brand-logo-box img:hover {
    transform: scale(1.03);
}

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

.brand-copy h2 {
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 10px;
    color: #ffffff;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.brand-copy p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    margin: 0 0 20px;
}

.brand-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.brand-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.brand-pill i {
    color: var(--accent-gold);
}

.brand-footer {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.65);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 16px;
}

/* ============================================================
   Right Form Section
   ============================================================ */
.auth-form-pane {
    flex: 1 1 55%;
    padding: 48px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #ffffff;
}

.form-header {
    margin-bottom: 30px;
}

.form-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--primary-red);
    background: #fef2f2;
    padding: 4px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.form-title {
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
    margin: 0 0 8px;
}

.form-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* Form Groups & Inputs */
.form-group-custom {
    margin-bottom: 20px;
    position: relative;
}

.form-label-custom {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

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

.input-icon-wrapper .input-icon-left {
    position: absolute;
    left: 16px;
    color: #94a3b8;
    font-size: 15px;
    transition: color 0.2s ease;
    pointer-events: none;
    z-index: 2;
}

.custom-input {
    width: 100%;
    height: 50px;
    padding: 12px 16px 12px 46px;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    background-color: #f8fafc;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.2s ease-in-out;
    outline: none;
}

.custom-input:focus {
    background-color: #ffffff;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 4px var(--input-focus-ring);
}

.custom-input:focus + .input-icon-left,
.input-icon-wrapper:focus-within .input-icon-left {
    color: var(--primary-red);
}

.password-toggle-btn {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    border-radius: 6px;
    transition: all 0.2s ease;
    z-index: 3;
}

.password-toggle-btn:hover {
    color: #475569;
    background: rgba(0, 0, 0, 0.04);
}

/* reCAPTCHA Container */
.recaptcha-box {
    margin: 22px 0;
    display: flex;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: 12px;
    overflow-x: auto;
}

/* Submit CTA Button */
.btn-submit-auth {
    width: 100%;
    height: 52px;
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 10px 20px -5px rgba(183, 28, 28, 0.45);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.btn-submit-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px -5px rgba(183, 28, 28, 0.55);
    background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
    color: #ffffff;
    text-decoration: none;
}

.btn-submit-auth:active {
    transform: translateY(0);
    box-shadow: 0 6px 14px -3px rgba(183, 28, 28, 0.4);
}

.btn-submit-auth i {
    transition: transform 0.2s ease;
}

.btn-submit-auth:hover i {
    transform: translateX(4px);
}

/* Form Helper & Security Footer */
.form-footer-meta {
    margin-top: 24px;
    text-align: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 16px;
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.form-footer-meta i {
    color: #22c55e;
}

/* ============================================================
   Page Loader Animation
   ============================================================ */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

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

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: #ef4444;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

.loader-text {
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

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

/* ============================================================
   Responsive Design Breakpoints
   ============================================================ */
@media (max-width: 900px) {
    .auth-card {
        max-width: 520px;
        flex-direction: column;
    }

    .auth-brand-pane {
        flex: 1 1 100%;
        min-height: auto;
        padding: 36px 28px 28px;
        text-align: center;
    }

    .brand-header-badge {
        margin: 0 auto 16px;
    }

    .brand-copy h2 {
        font-size: 22px;
    }

    .brand-badges {
        justify-content: center;
    }

    .brand-footer {
        display: none;
    }

    .auth-form-pane {
        flex: 1 1 100%;
        padding: 32px 28px 36px;
    }
}

@media (max-width: 480px) {
    .auth-wrapper {
        padding: 12px 8px;
    }

    .auth-brand-pane {
        padding: 28px 18px 22px;
    }

    .auth-form-pane {
        padding: 24px 18px 28px;
    }

    .form-title {
        font-size: 24px;
    }

    .recaptcha-box {
        transform: scale(0.92);
        transform-origin: center;
        padding: 4px;
    }
}

/* ============================================================
   Real-Time Validations & Feedback UI
   ============================================================ */
.custom-input.is-valid {
    border-color: #22c55e !important;
    background-color: #f0fdf4 !important;
}

.custom-input.is-valid:focus {
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2) !important;
}

.custom-input.is-invalid {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

.custom-input.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2) !important;
}

.form-feedback-msg {
    font-size: 12px;
    margin-top: 6px;
    display: none;
    align-items: center;
    gap: 5px;
    line-height: 1.3;
    animation: fadeInMsg 0.2s ease-in;
}

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

.form-feedback-msg.error-msg {
    color: #ef4444;
    font-weight: 500;
}

.form-feedback-msg.success-msg {
    color: #16a34a;
    font-weight: 500;
}

/* Password Strength Bar */
.pwd-strength-container {
    margin-top: 8px;
    display: none;
}

.pwd-strength-bar {
    height: 4px;
    width: 100%;
    background-color: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    gap: 4px;
}

.pwd-strength-segment {
    height: 100%;
    flex: 1;
    background: #e2e8f0;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.pwd-strength-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
    font-weight: 600;
}

/* reCAPTCHA Validation States */
.recaptcha-box {
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.recaptcha-box.is-valid {
    border-color: #22c55e !important;
    background-color: #f0fdf4 !important;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15) !important;
}

.recaptcha-box.is-invalid {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.recaptcha-status-text {
    font-size: 12px;
    text-align: center;
    margin-top: -12px;
    margin-bottom: 16px;
    display: none;
}

/* Inline Dynamic Alert */
.auth-live-alert {
    display: none;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    align-items: center;
    gap: 10px;
    animation: alertSlideDown 0.3s ease-out;
}

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

.auth-live-alert.alert-danger {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.auth-live-alert.alert-success {
    background-color: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

/* Shake Animation */
.shake-element {
    animation: shakeAnim 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shakeAnim {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

