/* ========================================
   Login Page - Ayuntamiento de Jerez
   ======================================== */

/* Reset y configuración base */
* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    word-wrap: break-word;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    min-height: 100vh;
    background-color: #ffffff;
    color: #1a1f36;
}

/* Layout principal */
.login-root {
    background: #fff;
    display: flex;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
}

/* Fondo decorativo */
.loginbackground {
    min-height: 100vh;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    z-index: 0;
    overflow: hidden;
}

.loginbackground-gridContainer {
    display: grid;
    grid-template-columns: [start] 1fr [left-gutter] repeat(16, 86.6px) [left-gutter] 1fr [end];
    grid-template-rows: [top] 1fr [top-gutter] repeat(8, 64px) [bottom-gutter] 1fr [bottom];
    justify-content: center;
    margin: 0 -2%;
    transform: rotate(-12deg) skew(-12deg);
}

/* Colores del fondo */
.box-divider--light-all-2 {
    box-shadow: inset 0 0 0 2px #e1e8f0;
}

.box-background--blue {
    background-color: #3b82f6;
}

.box-background--blue800 {
    background-color: #1e40af;
}

.box-background--gray100 {
    background-color: #f1f5f9;
}

.box-background--cyan200 {
    background-color: #7dd3fc;
}

/* Utilidades de layout */
.flex-flex {
    display: flex;
}

.flex-direction--column {
    flex-direction: column;
}

.flex-justifyContent--center {
    justify-content: center;
}

/* Formulario principal */
.formbg {
    margin: 0px auto;
    width: 100%;
    max-width: 448px;
    background: white;
    border-radius: 12px;
    box-shadow: rgba(60, 66, 87, 0.12) 0px 7px 14px 0px, rgba(0, 0, 0, 0.12) 0px 3px 6px 0px;
}

.formbg-outer {
    padding: 0 24px;
}

.formbg-inner {
    padding: 48px;
}

/* Títulos */
h1 {
    letter-spacing: -1px;
    font-weight: 700;
    color: #1a1f36;
}

.form-title {
    display: block;
    font-size: 24px;
    line-height: 32px;
    color: #1a1f36;
    font-weight: 600;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 16px;
    color: #64748b;
    margin-bottom: 32px;
    font-weight: 400;
}

/* Header con logo */
.header-section {
    text-align: center;
    margin-bottom: 48px;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.logo-icon {
    width: auto;
    height: 64px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.logo-icon img {
    width: auto;
    height: 48px;
    max-width: 120px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.logo-text {
    font-size: 32px;
    font-weight: 700;
    color: #1a1f36;
    margin: 0;
    line-height: 1.2;
}

.subtitle-header {
    font-size: 16px;
    color: #64748b;
    font-weight: 400;
    margin: 0;
}

/* Campos de formulario */
.field {
    margin-bottom: 24px;
}

.field label {
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    display: block;
    color: #374151;
}

.field input {
    font-size: 16px;
    line-height: 24px;
    padding: 12px 16px;
    width: 100%;
    min-height: 48px;
    border: 1px solid rgba(60, 66, 87, 0.16);
    border-radius: 8px;
    outline: none;
    background-color: #ffffff;
    transition: all 0.2s ease;
}

.field input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Botón de submit */
input[type="submit"] {
    background-color: #3b82f6;
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

input[type="submit"]:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

input[type="submit"]:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Footer */
.footer-link {
    text-align: center;
    padding-top: 24px;
}

.footer-link a {
    color: #64748b;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
}

.footer-link a:hover {
    color: #3b82f6;
}

/* ========================================
   Sistema de Mensajes - Pequeño y Discreto
   ======================================== */

.django-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 360px;
    min-width: 280px;
}

.message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 10px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 13px;
    border: 1px solid;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-out;
    backdrop-filter: blur(8px);
    min-height: 48px;
}

/* Tipos de mensajes */
.message.success {
    background: rgba(240, 253, 244, 0.97);
    border-color: rgba(187, 247, 208, 0.5);
    color: #15803d;
}

.message.success .message-icon {
    color: #22c55e;
}

.message.error {
    background: rgba(254, 242, 242, 0.97);
    border-color: rgba(254, 202, 202, 0.5);
    color: #b91c1c;
}

.message.error .message-icon {
    color: #ef4444;
}

.message.warning {
    background: rgba(254, 252, 232, 0.97);
    border-color: rgba(253, 230, 138, 0.5);
    color: #92400e;
}

.message.warning .message-icon {
    color: #f59e0b;
}

.message.info {
    background: rgba(248, 250, 252, 0.97);
    border-color: rgba(226, 232, 240, 0.6);
    color: #475569;
}

.message.info .message-icon {
    color: #64748b;
}

.message-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.message-text {
    flex: 1;
    font-weight: 500;
}

.message-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s ease;
    padding: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.message-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.08);
    transform: scale(1.1);
}

/* Animaciones */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }
}

.message.hiding {
    animation: slideOut 0.3s ease-in forwards;
}

/* Responsive */
@media (max-width: 768px) {
    .formbg-inner {
        padding: 32px 24px;
    }

    .loginbackground-gridContainer {
        transform: rotate(-8deg) skew(-8deg);
    }

    .logo-container {
        flex-direction: column;
        gap: 12px;
    }

    .logo-icon {
        height: 56px;
        padding: 8px 12px;
    }

    .logo-icon img {
        height: 40px;
        max-width: 100px;
    }

    .logo-text {
        font-size: 24px;
    }

    .form-title {
        font-size: 20px;
        line-height: 28px;
    }

    .django-messages {
        top: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
    }

    .message {
        padding: 11px 14px;
        font-size: 12px;
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    .formbg-outer {
        padding: 0 16px;
    }

    .formbg-inner {
        padding: 24px 20px;
    }

    .logo-icon {
        height: 48px;
        padding: 6px 10px;
    }

    .logo-icon img {
        height: 36px;
        max-width: 90px;
    }

    .logo-text {
        font-size: 20px;
    }

    .django-messages {
        top: 12px;
        right: 12px;
        left: 12px;
    }

    .message {
        padding: 10px 12px;
        font-size: 11px;
        min-height: 42px;
    }
}