/* ============================================================
   login.css  –  Pantalla de acceso GoCode
   Colores corporativos: #008080 (teal) + silver
   Resolución base: 1920 x 1080 (HD)
   ============================================================ */

/* ── Variables de marca ─────────────────────────────────────── */
:root {
    --teal:        #008080;
    --teal-dark:   #005f5f;
    --teal-light:  #00a8a8;
    --silver:      #c0c0c0;
    --silver-light:#e8e8e8;
    --silver-dark: #8a8a8a;
    --text-dark:   #2d3748;
    --text-mid:    #4a5568;
    --text-light:  #718096;
}

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

/* ── Fondo con blur ─────────────────────────────────────────── */
body.login-page {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    position: relative;
}

/* Imagen de fondo con blur y desvanecido via pseudo-elemento */
body.login-page::before {
    content: '';
    position: fixed;
    inset: -20px;          /* compensa el desbordamiento del blur */
    background: url('../img/fondo.jpg') center center / cover no-repeat;
    filter: blur(8px) brightness(0.55) saturate(0.85);
    z-index: -2;
}

/* Capa de degradado teal-silver sobre la imagen difuminada */
body.login-page::after {
    content: '';
    position: fixed;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 128, 128, 0.45) 0%,
        rgba(100, 120, 120, 0.30) 50%,
        rgba(192, 192, 192, 0.25) 100%
    );
    z-index: -1;
}

/* ── Modal / Card ───────────────────────────────────────────── */
.login-card {
    position: relative;
    z-index: 1;
    width: 460px;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 18px;
    box-shadow:
        0 2px 0   rgba(0, 128, 128, 0.80),   /* borde teal superior */
        0 28px 70px rgba(0, 0, 0, 0.40),
        0 6px 20px  rgba(0, 128, 128, 0.18);
    overflow: hidden;
    border-top: 4px solid var(--teal);
    animation: cardIn 0.50s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(36px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* ── Cabecera ───────────────────────────────────────────────── */
.login-header {
    background: linear-gradient(160deg, #ffffff 0%, #f2fafa 60%, #e6f5f5 100%);
    padding: 36px 44px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
}

/* Línea teal inferior que separa cabecera del cuerpo */
.login-header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--teal), var(--teal-light), var(--teal), transparent);
}

.login-header img.logo {
    height: 94px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 128, 128, 0.18));
}

.login-header h1 {
    color: var(--teal-dark);
    font-size: 1.00rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-align: center;
}

/* ── Cuerpo del formulario ──────────────────────────────────── */
.login-body {
    padding: 36px 44px 38px;
    background: #ffffff;
}

/* Grupo de campo */
.field-group {
    margin-bottom: 22px;
}

.field-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-mid);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 7px;
}

.field-group input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1.5px solid var(--silver);
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--text-dark);
    background: #f9fafa;
    transition: border-color 0.22s, box-shadow 0.22s, background 0.22s;
    outline: none;
}

.field-group input:focus {
    border-color: var(--teal);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 128, 128, 0.14);
}

.field-group input::placeholder {
    color: #b0b8c1;
}

/* Campo contraseña – wrapper para el ojito */
.pass-wrapper {
    position: relative;
}

.pass-wrapper input {
    padding-right: 50px;
}

.btn-toggle-pass {
    position: absolute;
    right: 0;
    top: 0;
    height: 48px;
    width: 48px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--silver-dark);
    transition: color 0.2s;
    padding: 0;
}

.btn-toggle-pass:hover  { color: var(--teal); }

.btn-toggle-pass svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

/* ── Divisor decorativo ─────────────────────────────────────── */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--silver-light), transparent);
    margin: 4px 0 24px;
}

/* ── Mensaje de error ───────────────────────────────────────── */
.login-error {
    display: none;
    background: #fff5f5;
    border: 1px solid #fc8181;
    border-radius: 8px;
    color: #c53030;
    font-size: 0.85rem;
    padding: 10px 14px;
    margin-bottom: 20px;
    align-items: center;
    gap: 8px;
}

.login-error.visible { display: flex; }

.login-error svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

/* ── Botón ingresar ─────────────────────────────────────────── */
.btn-login {
    width: 100%;
    height: 50px;
    background: linear-gradient(135deg, var(--teal-dark) 0%, var(--teal) 50%, var(--teal-light) 100%);
    background-size: 200% auto;
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-position 0.4s ease, transform 0.15s, box-shadow 0.2s, opacity 0.2s;
    box-shadow: 0 4px 16px rgba(0, 128, 128, 0.38);
    margin-top: 4px;
}

.btn-login:hover {
    background-position: right center;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 128, 128, 0.45);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(0, 128, 128, 0.30);
}

.btn-login:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.btn-login .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto;
}

.btn-login.loading .btn-text { display: none; }
.btn-login.loading .spinner  { display: block; }

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

/* ── Footer ─────────────────────────────────────────────────── */
.login-footer {
    border-top: 1px solid var(--silver-light);
    padding: 13px 44px;
    text-align: center;
    font-size: 0.73rem;
    color: var(--silver-dark);
    background: #fafafa;
    letter-spacing: 0.03em;
}
