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

:root {
    --primary: #2563eb;
    --secondary: #1e40af;
    --text-dark: #0f172a;
    --muted: #64748b;
    --card-bg: #f8fbff;
    --field-bg: #f1f5ff;
    --field-border: #cdd9ee;
}

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

body.login-body {
    min-height: 100vh;
    background: radial-gradient(circle at 16% 12%, rgba(96, 165, 250, 0.3), transparent 32%),
        radial-gradient(circle at 86% 78%, rgba(14, 165, 233, 0.22), transparent 34%),
        linear-gradient(136deg, #0f3f9f 0%, #1259cd 48%, #1e8eca 100%);
    font-family: 'Poppins', sans-serif;
    color: var(--text-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

html.signup-page,
html.signup-page body,
body.signup-body {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html.signup-page {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

body.signup-body::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

html.signup-page::-webkit-scrollbar,
html.signup-page body::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

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

.login-box {
    background: var(--card-bg);
    border: 1px solid rgba(191, 219, 254, 0.72);
    border-radius: 22px;
    box-shadow: 0 24px 44px rgba(15, 23, 42, 0.24);
    padding: 24px 26px 28px;
    position: relative;
    backdrop-filter: blur(6px);
}

.login-box::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.26), rgba(14, 165, 233, 0.2));
    z-index: -1;
}

.signup-container {
    max-width: 1060px;
}

.signup-split-box {
    padding: 20px 22px 22px;
}

.signup-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.signup-panel {
    background: rgba(255, 255, 255, 0.38);
    border: 1px solid #d7e4f7;
    border-radius: 16px;
    padding: 14px;
}

.signup-panel-title {
    font-size: 0.98rem;
    color: #1e3a8a;
    font-weight: 700;
    margin-bottom: 10px;
}

.signup-split-box .form-group {
    margin-bottom: 10px;
}

.signup-split-box .btn-login {
    height: 50px;
    margin-top: 10px;
}

.signup-social-auth {
    margin-top: 0;
}

.signup-panel-social .auth-divider {
    margin-bottom: 8px;
}

.signup-panel-social .social-buttons {
    justify-content: flex-start;
}

.signup-split-box .login-footer {
    margin-top: 14px;
}

.auth-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.auth-topbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.auth-brand img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.auth-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid #c6d8f5;
    color: #1e3a8a;
    background: #eaf2ff;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.auth-back-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(37, 99, 235, 0.2);
}

.auth-back-btn i {
    font-size: 0.88rem;
}

.auth-lang-btn {
    min-width: 58px;
    justify-content: center;
    padding-inline: 12px;
}

.login-header {
    margin-bottom: 14px;
    text-align: center;
}

.login-header h1 {
    color: var(--text-dark);
    font-size: 1.76rem;
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.login-header p {
    color: #5d7391;
    font-size: 0.95rem;
    line-height: 1.1;
    font-weight: 500;
    margin-top: 6px;
    margin-bottom: 10px;
}

.login-header h2 {
    font-size: 2.08rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
}

.alert {
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 13px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.alert-error {
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.alert-info {
    background: #e0e7ff;
    border: 1px solid #c7d2fe;
    color: #1e3a8a;
}

.lockout-banner {
    align-items: flex-start;
    gap: 10px;
}

.lockout-banner i {
    margin-top: 2px;
}

#login-lockout-countdown {
    display: inline-block;
    min-width: 62px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: #203c64;
    font-weight: 600;
    font-size: 0.92rem;
}

.form-control {
    width: 100%;
    height: 50px;
    padding: 10px 14px;
    border: 2px solid var(--field-border);
    border-radius: 10px;
    background: var(--field-bg);
    font-size: 0.9rem;
    color: #1f2937;
    font-family: 'Poppins', sans-serif;
}

.form-group input:not([type="checkbox"]),
.form-group select,
.form-group textarea {
    width: 100%;
    height: 50px;
    padding: 10px 14px;
    border: 2px solid var(--field-border);
    border-radius: 10px;
    background: var(--field-bg);
    font-size: 0.9rem;
    color: #1f2937;
    font-family: 'Poppins', sans-serif;
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 46px;
}

.password-toggle-btn {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #5b6b85;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.password-toggle-btn:hover {
    color: #1e3a8a;
    background: rgba(37, 99, 235, 0.08);
}

.password-toggle-btn:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 1px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 52, 157, 0.12);
}

.form-group input:not([type="checkbox"]):focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 52, 157, 0.12);
}

/* Resalta en rojo solo despues de intento invalido */
form.was-validated .form-group input:not([type="checkbox"]):required:invalid,
form.was-validated .form-group select:required:invalid,
form.was-validated .form-group textarea:required:invalid,
.form-group input:not([type="checkbox"]).is-live-invalid,
.form-group select.is-live-invalid,
.form-group textarea.is-live-invalid {
    border-color: #dc2626;
    background: #fef2f2;
}

form.was-validated .form-group input:not([type="checkbox"]):required:invalid:focus,
form.was-validated .form-group select:required:invalid:focus,
form.was-validated .form-group textarea:required:invalid:focus,
.form-group input:not([type="checkbox"]).is-live-invalid:focus,
.form-group select.is-live-invalid:focus,
.form-group textarea.is-live-invalid:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.16);
}

.form-control::placeholder {
    color: #95a3bb;
}

.forgot-password {
    display: block;
    margin-top: 9px;
    text-align: right;
    color: #5b6cff;
    font-size: 0.82rem;
    text-decoration: none;
}

.forgot-password:hover {
    color: #4657e0;
}

.btn-login {
    width: 100%;
    border: none;
    border-radius: 10px;
    height: 54px;
    margin-top: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 52%, #0ea5e9 100%);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    box-shadow: 0 12px 26px rgba(37, 99, 235, 0.34);
}

.btn-login:hover {
    background: linear-gradient(135deg, #1f52cf 0%, #1e40af 52%, #0b94d9 100%);
    transform: translateY(-1px);
}

.btn-login:disabled {
    background: linear-gradient(135deg, #cbd5e1 0%, #b8c2d1 100%);
    color: #64748b;
    border: 1px solid #94a3b8;
    opacity: 1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    filter: grayscale(0.35);
}

.btn-login:disabled:hover {
    background: linear-gradient(135deg, #cbd5e1 0%, #b8c2d1 100%);
    transform: none;
}

.email-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 56px;
    padding: 7px 10px;
    border-radius: 14px;
    background: linear-gradient(135deg, #eef2ff 0%, #ede9fe 100%);
    border: 1px solid #c7d2fe;
    box-shadow: 0 8px 18px rgba(79, 99, 215, 0.15);
}

.email-chip-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #dbe3ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.email-chip-icon i {
    font-size: 19px;
    background: conic-gradient(from -45deg, #ea4335 0deg 90deg, #fbbc05 90deg 180deg, #34a853 180deg 270deg, #4285f4 270deg 360deg);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.email-chip-input.form-control {
    background: transparent;
    border: 0;
    box-shadow: none;
    height: 100%;
    font-size: 15px;
    font-weight: 600;
    color: #203a68;
    padding: 0 6px;
}

.email-chip-input.form-control:focus {
    box-shadow: none;
    border: 0;
}

.email-chip-status {
    flex: 0 0 auto;
    padding: 7px 11px;
    border-radius: 999px;
    background: linear-gradient(135deg, #4f63d7 0%, #7a4cc0 100%);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.social-auth {
    margin-top: 12px;
}

.auth-divider {
    display: block;
    margin-bottom: 10px;
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: lowercase;
}

.social-actions {
    /* block container for policy consent + buttons */
}

.social-google-form {
    width: 100%;
}

.policy-consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.policy-consent input[type="checkbox"] {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    margin-top: 3px;
    accent-color: var(--primary);
    cursor: pointer;
}

.policy-consent input[type="checkbox"]:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.policy-consent label {
    display: inline;
    font-weight: 400;
    color: #5d7391;
    font-size: 0.82rem;
    margin-bottom: 0;
    cursor: pointer;
    line-height: 1.5;
}

.policy-consent a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.policy-consent a:hover {
    color: var(--secondary);
}

.social-buttons {
    display: flex;
    justify-content: center;
    gap: 14px;
}

.social-icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 2px solid transparent;
    background: #dbe7ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--primary);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    box-shadow: 0 8px 18px rgba(47, 52, 157, 0.2);
}

.social-icon-btn i {
    font-size: 22px;
}

.social-icon-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.03);
    box-shadow: 0 12px 22px rgba(47, 52, 157, 0.24);
}

.social-icon-btn.google {
    background: #ffffff;
    border-color: #e5e7eb;
}

.social-icon-btn.google i {
    background: conic-gradient(from -45deg, #ea4335 0deg 90deg, #fbbc05 90deg 180deg, #34a853 180deg 270deg, #4285f4 270deg 360deg);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.social-icon-btn.facebook {
    background: linear-gradient(180deg, #2b7dff 0%, #1b64f2 100%);
    border-color: #2a65e8;
}

.social-icon-btn.facebook i {
    color: #ffffff;
}

.social-icon-btn.is-disabled {
    opacity: 0.9;
    cursor: not-allowed;
}

.social-icon-btn:disabled:not(.is-disabled) {
    background: #dbe2ee;
    border-color: #a4b1c3;
    color: #8091a8;
    opacity: 1;
    cursor: not-allowed;
    transform: none;
    filter: none;
    box-shadow: none;
}

.social-icon-btn:disabled:not(.is-disabled):hover {
    transform: none;
    filter: none;
    box-shadow: none;
}

.social-icon-btn.is-disabled:hover {
    transform: none;
    filter: none;
    box-shadow: 0 8px 18px rgba(47, 52, 157, 0.2);
}

.login-footer {
    margin-top: 22px;
    text-align: center;
}

.login-footer p {
    color: #5f6f8a;
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-register-link {
    display: inline;
    margin-left: 6px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: #1d4ed8;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 700;
    box-shadow: none;
}

.btn-register-link:hover {
    color: #1e40af;
}

.error {
    color: #dc2626;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

body.modal-open {
    overflow: hidden;
}

.legal-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.legal-modal[hidden] {
    display: none;
}

.legal-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(2px);
}

.legal-modal-dialog {
    position: relative;
    width: min(920px, 100%);
    height: min(84vh, 760px);
    border-radius: 16px;
    border: 1px solid #cdd9ee;
    background: #f8fbff;
    box-shadow: 0 24px 44px rgba(15, 23, 42, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.legal-modal-header {
    height: 56px;
    padding: 0 16px;
    border-bottom: 1px solid #d7e4f7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #eef4ff;
}

.legal-modal-header h3 {
    font-size: 1rem;
    color: #1e3a8a;
    font-weight: 700;
}

.legal-modal-close {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid #c7d2fe;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
}

.legal-modal-close:hover {
    background: #e2e8f0;
}

.legal-modal-frame {
    width: 100%;
    height: calc(100% - 56px);
    border: 0;
    background: #ffffff;
}

@media (max-width: 720px) {
    .signup-container {
        max-width: 500px;
    }

    .signup-grid {
        grid-template-columns: 1fr;
    }

    .signup-panel + .signup-panel {
        margin-top: 4px;
    }

    .login-box {
        padding: 26px 18px 24px;
    }

    .auth-brand img {
        width: 36px;
        height: 36px;
    }

    .auth-back-btn {
        height: 36px;
        padding: 0 12px;
        font-size: 0.86rem;
    }

    .login-header h1 {
        font-size: 30px;
    }

    .login-header p {
        font-size: 15px;
    }

    .login-header h2 {
        font-size: 30px;
    }

    .form-group label {
        font-size: 15px;
    }

    .btn-login {
        font-size: 16px;
    }
}

@media (max-width: 430px) {
    body.login-body {
        padding: 10px;
    }

    .login-box {
        padding: 22px 14px 20px;
    }

    .login-header h1 {
        font-size: 24px;
    }

    .login-header p {
        font-size: 14px;
    }

    .login-header h2 {
        font-size: 24px;
    }

    .form-group label {
        font-size: 15px;
    }

    .form-control {
        height: 46px;
        font-size: 13px;
    }

    .btn-login {
        font-size: 16px;
        height: 50px;
    }

    .auth-divider {
        font-size: 16px;
    }

    .btn-register-link {
        margin-left: 0;
        margin-top: 10px;
    }

    .legal-modal {
        padding: 10px;
    }

    .legal-modal-dialog {
        height: 88vh;
        border-radius: 12px;
    }
}

body.theme-dark.login-body {
    --card-bg: #0f172a;
    --field-border: #334155;
    --field-bg: #0f172a;
    --muted: #94a3b8;
}

body.theme-dark .login-box {
    border-color: #243247;
    box-shadow: 0 18px 34px rgba(2, 6, 23, 0.5);
}

body.theme-dark .auth-brand {
    filter: brightness(1.08);
}

body.theme-dark .auth-back-btn {
    background: #13213a;
    border-color: #334155;
    color: #cbd5e1;
}

body.theme-dark .auth-back-btn:hover {
    background: #1e293b;
}

body.theme-dark .login-header h1,
body.theme-dark .login-header p,
body.theme-dark .login-header h2 {
    color: #dbeafe;
}

body.theme-dark .form-group label,
body.theme-dark .login-footer p,
body.theme-dark .forgot-password {
    color: #94a3b8;
}

body.theme-dark .auth-divider {
    color: #cbd5e1;
}

body.theme-dark .form-control {
    color: #e2e8f0;
}

body.theme-dark .form-group input,
body.theme-dark .form-group select,
body.theme-dark .form-group textarea {
    color: #e2e8f0;
}

body.theme-dark .password-toggle-btn {
    color: #94a3b8;
}

body.theme-dark .password-toggle-btn:hover {
    color: #e2e8f0;
    background: rgba(148, 163, 184, 0.12);
}

body.theme-dark .email-chip {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    border-color: #334155;
    box-shadow: 0 12px 24px rgba(2, 6, 23, 0.45);
}

body.theme-dark .email-chip-icon {
    background: #0b1220;
    border-color: #334155;
}

body.theme-dark .email-chip-input.form-control {
    color: #e2e8f0;
}

body.theme-dark .social-icon-btn {
    background: #1e3a8a;
    border-color: #3b82f6;
}

body.theme-dark .social-icon-btn.is-disabled:hover {
    background: #1e3a8a;
}

body.theme-dark .social-icon-btn.google {
    background: #0f172a;
    border-color: #334155;
}

body.theme-dark .legal-modal-dialog {
    border-color: #334155;
    background: #0f172a;
}

body.theme-dark .legal-modal-header {
    border-bottom-color: #334155;
    background: #13213a;
}

body.theme-dark .legal-modal-header h3 {
    color: #dbeafe;
}

body.theme-dark .legal-modal-close {
    border-color: #334155;
    background: #1e293b;
    color: #e2e8f0;
}

body.theme-dark .legal-modal-close:hover {
    background: #334155;
}
