/* ===========================================================
   ELECTROFÁCIL CRM - Estilos del Login
   =========================================================== */

:root {
    --ef-blue:        #1d4ed8;
    --ef-blue-dark:   #1e3a8a;
    --ef-blue-deep:   #16308a;
    --ef-red:         #d12027;
    --ef-text:        #1f2937;
    --ef-muted:       #6b7280;
    --ef-border:      #e5e7eb;
    --ef-field-bg:    #f8fafc;
    --ef-field-border:#e2e8f0;
    --ef-radius:      14px;
    --ef-shadow:      0 25px 60px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body.ef-auth {
    margin: 0;
    font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--ef-text);
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background-color: var(--ef-blue-deep);
    background-image:
        radial-gradient(rgba(255, 255, 255, .06) 1.5px, transparent 1.5px);
    background-size: 22px 22px;
}

/* ====== Tarjeta ====== */
.ef-login-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 26px;
    padding: 2.4rem 2.4rem 2rem;
    box-shadow: var(--ef-shadow);
    animation: ef-pop .45s cubic-bezier(.2, .8, .2, 1);
}

@keyframes ef-pop {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

/* ====== Marca / Logo ====== */
.ef-brand { text-align: center; margin-bottom: 1.4rem; }

.ef-brand-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .7rem;
}

.ef-badge {
    width: 64px;
    height: 64px;
    flex: 0 0 auto;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .2));
}

.ef-wordmark { line-height: 1; }

.ef-word {
    font-weight: 800;
    font-size: 1.9rem;
    letter-spacing: .5px;
    background: linear-gradient(180deg, #dbe6ff 0%, #1d4ed8 55%, #16308a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .4);
}

.ef-ribbon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin-top: .35rem;
}

.ef-line {
    height: 2px;
    width: 38px;
    background: var(--ef-blue-dark);
    border-radius: 2px;
}

.ef-ribbon {
    background: var(--ef-red);
    color: #fff;
    font-size: .72rem;
    font-weight: 500;
    padding: .18rem .6rem;
    border-radius: 5px;
    white-space: nowrap;
}
.ef-ribbon b i { font-style: italic; font-weight: 700; }

/* ====== Títulos ====== */
.ef-title {
    text-align: center;
    color: var(--ef-blue-dark);
    font-size: 1.7rem;
    font-weight: 700;
    margin: .3rem 0 .15rem;
}

.ef-subtitle {
    text-align: center;
    color: var(--ef-muted);
    font-size: .92rem;
    margin: 0 0 1.5rem;
}

/* ====== Formulario ====== */
.ef-field { margin-bottom: 1.05rem; }

.ef-field > label {
    display: block;
    font-weight: 600;
    font-size: .9rem;
    color: var(--ef-blue);
    margin-bottom: .4rem;
}

.ef-input {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--ef-field-bg);
    border: 1.5px solid var(--ef-field-border);
    border-radius: var(--ef-radius);
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.ef-input:focus-within {
    border-color: var(--ef-blue);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(29, 78, 216, .12);
}

.ef-input > svg {
    width: 20px;
    height: 20px;
    margin: 0 .25rem 0 .85rem;
    color: var(--ef-muted);
    flex: 0 0 auto;
}

.ef-input input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    padding: .85rem .7rem;
    font-size: .95rem;
    font-family: inherit;
    color: var(--ef-text);
}

.ef-input input::placeholder { color: #9aa3af; }

.ef-eye {
    border: 0;
    background: transparent;
    cursor: pointer;
    color: var(--ef-muted);
    padding: .4rem .85rem .4rem .4rem;
    display: grid;
    place-items: center;
    transition: color .2s;
}
.ef-eye:hover { color: var(--ef-blue); }
.ef-eye svg { width: 20px; height: 20px; }

/* ====== Fila recordarme / olvido ====== */
.ef-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin: .2rem 0 1.3rem;
    flex-wrap: wrap;
}

.ef-check {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-size: .9rem;
    color: var(--ef-muted);
    cursor: pointer;
    user-select: none;
}
.ef-check input { width: 16px; height: 16px; accent-color: var(--ef-blue); cursor: pointer; }

.ef-link {
    color: var(--ef-blue);
    font-size: .9rem;
    font-weight: 500;
    text-decoration: none;
}
.ef-link:hover { text-decoration: underline; }

/* ====== Botón ====== */
.ef-btn {
    width: 100%;
    border: 0;
    border-radius: var(--ef-radius);
    background: var(--ef-blue-dark);
    color: #fff;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    padding: .95rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    transition: background .2s, transform .1s, box-shadow .2s;
    box-shadow: 0 8px 20px rgba(30, 58, 138, .28);
}
.ef-btn:hover { background: #1b3494; }
.ef-btn:active { transform: translateY(1px); }
.ef-btn[disabled] { opacity: .8; cursor: not-allowed; }

.ef-spinner {
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    border-radius: 50%;
    display: none;
    animation: ef-spin .7s linear infinite;
}
.ef-btn.loading .ef-spinner { display: inline-block; }
.ef-btn.loading .ef-btn-text { opacity: .85; }

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

/* ====== Divisor ====== */
.ef-divider {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin: 1.5rem 0 1rem;
    color: var(--ef-muted);
    font-size: .85rem;
}
.ef-divider::before, .ef-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--ef-border);
}

/* ====== Seguro ====== */
.ef-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    color: var(--ef-blue-dark);
    font-size: .88rem;
    font-weight: 500;
    margin: .2rem 0 0;
}
.ef-secure svg { width: 18px; height: 18px; }

/* ====== Toasts ====== */
.toast-container {
    position: fixed;
    top: 1.2rem;
    right: 1.2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    max-width: calc(100vw - 2rem);
}

.toast {
    display: flex;
    align-items: center;
    gap: .65rem;
    background: #fff;
    color: var(--ef-text);
    padding: .85rem 1.1rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
    border-left: 4px solid var(--ef-blue);
    font-size: .92rem;
    min-width: 240px;
    animation: ef-toast-in .3s ease;
}
.toast.success { border-left-color: #16a34a; }
.toast.error   { border-left-color: var(--ef-red); }
.toast.hide    { animation: ef-toast-out .3s ease forwards; }
.toast svg { width: 20px; height: 20px; flex: 0 0 auto; }
.toast.success svg { color: #16a34a; }
.toast.error svg   { color: var(--ef-red); }

@keyframes ef-toast-in  { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes ef-toast-out { to { opacity: 0; transform: translateX(30px); } }

/* ====== Responsive ====== */
@media (max-width: 480px) {
    .ef-login-card { padding: 1.8rem 1.4rem 1.5rem; border-radius: 20px; }
    .ef-word { font-size: 1.55rem; }
    .ef-badge { width: 54px; height: 54px; }
    .ef-title { font-size: 1.45rem; }
    .toast-container { left: 1rem; right: 1rem; }
    .toast { min-width: 0; width: 100%; }
}
