@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
:root {
    --orange:     #f2aa1f;
    --orange-dark:#e09410;
    --blue:       #114358;
    --blue-dark:  #2d3e52;
    --bg:         #f1ece7;
    --white:      #ffffff;
    --input-bg:   #EFF3F6;
    --text:       #2d2d2d;
    --text-muted: #8a97a5;
    --valid:      #3AB397;
    --invalid:    #e05252;
    --warning:    #f0a500;
    --transition: 0.5s ease-in-out;
}

* { 
    margin:0; 
    padding:0; 
    box-sizing:border-box; 
    font-family:"Inter",sans-serif; 
}

/* ── OVERLAY ────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ── MODAL BOX ──────────────────────────────────── */
.modal-box {
    position: relative;
    width: 100%;
    max-width: 760px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transform: scale(0.92) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.22,1,0.36,1);
}

.modal-overlay.active .modal-box {
    transform: scale(1) translateY(0);
}

/* ── CLOSE BUTTON X ─────────────────────────────── */
.modal-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: white;
    color: #555;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: background 0.2s, color 0.2s, transform 0.15s;
}

.modal-close:hover {
    background: var(--invalid);
    color: white;
    transform: scale(1.1);
}

/* ── MOBILE TABS ────────────────────────────────── */
.mobile-tabs {
    display: none;
    background: white;
    border-radius: 30px;
    padding: 5px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
    width: 100%;
    max-width: 400px;
}

.tab-btn1, .tab-btn2{
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 25px;
    background: transparent;
    color: #999;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
    font-family: "Inter", sans-serif;
}

.tab-btn1.active {
    background: var(--blue);
    color: white;
    font-weight: 600;
}

.tab-btn2.active {
    background: var(--orange);
    color: white;
    font-weight: 600;
}

/* ── AUTH CARD ──────────────────────────────────── */
.auth-card {
    position: relative;
    width: 100%;
    height: 430px;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    display: flex;
}

/* ── FORM PANELS ────────────────────────────────── */
.form-panel {
    width: 55%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 36px;
    position: absolute;
    top: 0;
    background: var(--white);
    transition: transform var(--transition), opacity var(--transition);
    z-index: 1;
}

.sign-in-panel { 
    right: 0; 
    transform: translateX(0); 
    opacity: 1; 
}
.sign-up-panel { 
    left: 0;  
    transform: translateX(-100%); 
    opacity: 0; 
}

.auth-card.toggle .sign-in-panel { 
    transform: translateX(100%); 
    opacity: 0; 
}
.auth-card.toggle .sign-up-panel { 
    transform: translateX(0);   
    opacity: 1; 
}

form { 
    width:100%; 
    display:flex; 
    flex-direction:column; 
    align-items:center; 
}

.form-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
    align-self: flex-start;
}

/* ── SOCIAL ICONS ───────────────────────────────── */
.social-networks {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    align-self: flex-start;
}

.social-networks i {
    border: 1.5px solid #C9CCCB;
    border-radius: 6px;
    padding: 7px;
    cursor: pointer;
    font-size: 17px;
    transition: border-color 0.2s, color 0.2s, transform 0.2s;
}

.social-networks.social-login i:hover {
    border-color: var(--orange);
    color: var(--orange);
    transform: scale(1.12);
}

.social-networks.social-register i:hover {
    border-color: var(--blue);
    color: var(--blue);
    transform: scale(1.12);
}

.form-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
    align-self: flex-start;
}

/* ── INPUTS ─────────────────────────────────────── */
.input-group-custom {
    width: 100%;
    height: 42px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    background: var(--input-bg);
    border-radius: 8px;
    border: 2px solid transparent;
    margin-bottom: 4px;
    transition: border-color 0.25s, background 0.25s;
}

.input-group-custom.focused { border-color: var(--blue); background: #f5f8fb; }
.input-group-custom.valid   { border-color: var(--valid); }
.input-group-custom.invalid { border-color: var(--invalid); background: #fff8f8; }

.input-group-custom input {
    border: none; 
    outline: none; 
    width: 100%; 
    height: 100%;
    background: transparent; 
    font-size: 13px; 
    color: var(--text);
}
.input-group-custom input::placeholder { color: var(--text-muted); }

.input-icon { 
    font-size: 17px; 
    color: var(--text-muted); 
    flex-shrink: 0; 
    transition: color 0.25s, transform 0.25s; 
}
.input-group-custom.focused .input-icon { color: var(--blue); transform: scale(1.15); }
.input-group-custom.valid   .input-icon { color: var(--valid); }
.input-group-custom.invalid .input-icon { color: var(--invalid); }

.status-icon  { 
    font-size: 15px; 
    flex-shrink: 0; 
    opacity: 0; 
    transition: opacity 0.2s; 
}
.valid-icon   { color: var(--valid); }
.invalid-icon { color: var(--invalid); }
.input-group-custom.valid   .valid-icon   { opacity: 1; }
.input-group-custom.invalid .invalid-icon { opacity: 1; }

.toggle-password { 
    font-size: 17px; 
    color: var(--text-muted); 
    cursor: pointer; 
    flex-shrink: 0; 
    transition: color 0.2s; 
}
.toggle-password:hover { color: var(--blue); }

/* ── FIELD ERROR ────────────────────────────────── */
.field-error {
    font-size: 11px; 
    color: var(--invalid); 
    min-height: 14px;
    margin-bottom: 4px; 
    display: block; 
    padding-left: 4px;
    align-self: flex-start; 
    width: 100%;
}

/* ── PASSWORD STRENGTH ──────────────────────────── */
.strength-wrapper { 
    width:100%; 
    margin-bottom:8px; 
    display:none; 
    flex-direction:column; 
    gap:3px; 
}
.strength-wrapper.visible { display: flex; }
.strength-bar { 
    width:100%; 
    height:4px; 
    background:#ddd; 
    border-radius:10px; 
    overflow:hidden; 
}
.strength-fill { 
    height:100%; 
    width:0%; 
    border-radius:10px; 
    transition:width 0.4s ease,background-color 0.4s ease; 
}
.strength-fill.weak   { width:33%;  background:var(--invalid); }
.strength-fill.medium { width:66%;  background:var(--warning); }
.strength-fill.strong { width:100%; background:var(--valid); }
.strength-label        { font-size:11px; color:#aaa; }
.strength-label.weak   { color:var(--invalid); }
.strength-label.medium { color:var(--warning); }
.strength-label.strong { color:var(--valid); }

/* ── LOCKOUT ────────────────────────────────────── */
.lockout-info {
    display:flex; 
    align-items:center; 
    gap:6px; 
    background:#fff0f0;
    border:1px solid #f5c0c0; 
    border-radius:6px; 
    padding:6px 12px;
    font-size:11px; 
    color:#c0392b; 
    width:100%; 
    margin-bottom:6px;
}

/* ── FORGOT LINK ────────────────────────────────── */
.forgot-link {
    font-size: 13px; 
    color: var(--text); 
    text-decoration: none;
    margin-bottom: 14px; 
    margin-top: 4px; 
    align-self: flex-start; 
    transition: color 0.2s;
}
.forgot-link:hover { color: var(--orange); }

/* ── BUTTONS ────────────────────────────────────── */
.btn-auth {
    width: 100%; 
    height: 44px; 
    font-size: 13px; 
    font-weight: 700;
    letter-spacing: 0.5px; 
    border: none; 
    border-radius: 8px; 
    cursor: pointer;
    color: var(--white); 
    display: flex; 
    align-items: center; 
    justify-content: center;
    gap: 8px; 
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s; 
    margin-top: 4px;
}

.btn-login    { background: var(--blue); }
.btn-register { background: var(--orange); }

.btn-auth:hover:not(:disabled) { 
    opacity:0.9; 
    transform:translateY(-1px); 
    box-shadow:0 6px 16px rgba(0,0,0,0.18); 
}
.btn-auth:active:not(:disabled){ transform:translateY(0); }
.btn-auth:disabled { opacity:0.55; cursor:not-allowed; }

.spin { 
    display:inline-block; 
    animation:spin 0.7s linear infinite; 
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── PANEL DECORATIVO ───────────────────────────── */
.deco-panel {
    position: absolute;
    left: 0; top: 0;
    width: 45%; height: 100%;
    background: var(--orange);
    border-radius: 0 60% 60% 0 / 0 50% 50% 0;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    transition: background var(--transition), left var(--transition), border-radius var(--transition);
    z-index: 2;
}

.auth-card.toggle .deco-panel {
    left: 55%;
    background: var(--blue);
    border-radius: 60% 0 0 60% / 50% 0 0 50%;
}

.deco-content {
    position: absolute;
    display: flex; 
    flex-direction: column; 
    align-items: center;
    justify-content: center; 
    gap: 12px; 
    padding: 30px 24px;
    color: var(--white); 
    text-align: center;
    transition: transform var(--transition), opacity var(--transition);
    width: 100%;
}

.deco-login    { transform: translateX(0);    opacity: 1; }
.deco-register { transform: translateX(-120%); opacity: 0; }

.auth-card.toggle .deco-login    { transform: translateX(120%); opacity: 0; }
.auth-card.toggle .deco-register { transform: translateX(0);    opacity: 1; }

.deco-logo {
    width: 75px; 
    height: 75px; 
    object-fit: contain;
    filter: brightness(0) invert(1);
    margin-bottom: 4px;
}

.deco-content h3 { 
    font-size: 17px; 
    font-weight: 700; 
    line-height: 1.2; 
}
.deco-content p  { 
    font-size: 12px; 
    opacity: 0.88; 
    line-height: 1.5; 
    max-width: 180px; 
}

.btn-deco {
    background: transparent; 
    border: 2px solid var(--white); 
    border-radius: 20px;
    color: var(--white); 
    font-size: 12px; 
    font-weight: 600; 
    padding: 7px 24px;
    cursor: pointer; 
    transition: background 0.2s, transform 0.15s; 
    margin-top: 4px;
    font-family: "Inter", sans-serif;
}
.btn-deco:hover { background: rgba(255,255,255,0.2); transform: translateY(-1px); }

/* ── TOAST ──────────────────────────────────────── */
#toast-container {
    position: fixed; 
    top: 20px; 
    right: 20px;
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
    z-index: 9999;
}

.toast-custom {
    min-width:260px; 
    max-width:320px; 
    background:white; 
    border-radius:10px;
    padding:14px 18px; 
    display:flex; 
    align-items:flex-start; 
    gap:12px;
    box-shadow:0 8px 24px rgba(0,0,0,0.15);
    animation:toastIn 0.35s cubic-bezier(0.22,1,0.36,1);
    border-left:4px solid var(--valid); 
    position:relative; 
    overflow:hidden;
}
.toast-custom.error   { border-left-color:var(--invalid); }
.toast-custom.warning { border-left-color:var(--warning); }
.toast-custom.success { border-left-color:var(--valid); }
.toast-custom.hide    { animation:toastOut 0.3s ease forwards; }

.toast-icon { 
    font-size:20px; 
    flex-shrink:0; 
    margin-top:1px; 
}
.toast-custom.success .toast-icon { color:var(--valid); }
.toast-custom.error   .toast-icon { color:var(--invalid); }
.toast-custom.warning .toast-icon { color:var(--warning); }

.toast-body  { flex:1; }
.toast-title { 
    font-size:13px; 
    font-weight:700; 
    margin-bottom:2px; 
}
.toast-msg   { 
    font-size:12px; 
    color:#666; 
    line-height:1.4; 
}

.toast-close { font-size:16px; 
    color:#aaa; 
    cursor:pointer; 
    flex-shrink:0; 
    transition:color 0.15s; 
    align-self:center; 
}
.toast-close:hover { color:#333; }

.toast-progress { 
    position:absolute; 
    bottom:0; 
    left:0; 
    height:3px; 
    border-radius:0 0 0 10px; 
    animation:toastProgress 4s linear forwards; 
}
.toast-custom.success .toast-progress { background:var(--valid); }
.toast-custom.error   .toast-progress { background:var(--invalid); }
.toast-custom.warning .toast-progress { background:var(--warning); }

@keyframes toastIn       { from{opacity:0;transform:translateX(40px)} to{opacity:1;transform:translateX(0)} }
@keyframes toastOut      { from{opacity:1;transform:translateX(0);max-height:100px} to{opacity:0;transform:translateX(40px);max-height:0} }
@keyframes toastProgress { from{width:100%} to{width:0%} }

/* ── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 767px) {

    .modal-overlay { padding: 12px; align-items: center; }

    .modal-close { top: -12px; right: -4px; }

    /* Mostrar tabs */
    .mobile-tabs { display: flex; }

    /* Ocultar panel decorativo */
    .deco-panel { display: none !important; }

    /* Card full width */
    .auth-card {
        height: 460px;
        border-radius: 16px;
    }

    /* Ambos panels full width */
    .form-panel {
        width: 100%;
        padding: 28px 22px;
    }

    /* Solo fade, sin translate en móvil */
    .sign-in-panel { 
        right:auto; 
        left:0; 
        transform:translateX(0) !important; 
        opacity:1 !important; 
    }
    .sign-up-panel { 
        position:absolute; 
        top:0; 
        left:0; 
        transform:translateX(0) !important; 
        opacity:0 !important; 
        pointer-events:none; 
    }

    .auth-card.toggle .sign-in-panel { opacity:0 !important; pointer-events:none; }
    .auth-card.toggle .sign-up-panel { opacity:1 !important; pointer-events:all; }
}

@media (max-width: 480px) {
    .auth-card { height: auto; min-height: 440px; border-radius: 14px; }
    .form-panel { padding: 24px 18px; }
    .form-title { font-size: 20px; }
}
