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

.login-body {
    font-family: 'DM Sans', sans-serif;
    background: #f0f4f8;
    min-height: 100vh;
}

/* ─── Full-screen wrapper ─────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    background: #f0f4f8;
    position: relative;
    overflow: hidden;
}

/* ─── Decorative background blobs ────────────────────────── */
.login-page::before {
    content: '';
    position: absolute;
    top: -120px;
    right: -120px;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(41,182,246,0.15), transparent 70%);
    pointer-events: none;
}
.login-page::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(10,61,122,0.10), transparent 70%);
    pointer-events: none;
}

/* ─── Branding panel (left) ──────────────────────────────── */
.login-brand {
    flex: 1 1 50%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 40px;
    position: relative;
    background: linear-gradient(160deg, #0a3d7a 0%, #1565c0 60%, #29b6f6 100%);
    overflow: hidden;
}

/* Decorative geometric shapes */
.login-brand .geom-square {
    position: absolute;
    top: 40px;
    left: 40px;
    width: 60px;
    height: 60px;
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 14px;
    transform: rotate(15deg);
}
.login-brand .geom-circle {
    position: absolute;
    bottom: 80px;
    right: 60px;
    width: 90px;
    height: 90px;
    border: 2px solid rgba(255,255,255,0.10);
    border-radius: 50%;
}
.login-brand .geom-diamond {
    position: absolute;
    top: 30%;
    right: 40px;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
    transform: rotate(45deg);
}

.login-brand-content {
    position: relative;
    z-index: 1;
    max-width: 340px;
    text-align: center;
}

.login-brand-logo-box {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -1px;
    border: 1px solid rgba(255,255,255,0.2);
}

/* Mobile-only elements (hidden on desktop) */
.login-brand-name,
.login-brand-tagline {
    display: none;
}

.login-brand-headline {
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 14px;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.login-brand-sub {
    color: rgba(255,255,255,0.7);
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
    font-weight: 400;
}

.login-brand-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 32px;
}

.login-brand-pill {
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.85);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.3px;
    backdrop-filter: blur(6px);
}

/* ─── Form panel (right) ─────────────────────────────────── */
.login-form-panel {
    flex: 1 1 50%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 48px;
    position: relative;
    z-index: 1;
}

.login-form-inner {
    width: 100%;
    max-width: 400px;
}

/* ─── Logo (form panel) ──────────────────────────────────── */
.login-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 36px;
    text-decoration: none;
}

.login-logo-box {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0a3d7a, #29b6f6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 16px;
    letter-spacing: -0.5px;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(21,101,192,0.27);
}

.login-logo-text {
    display: flex;
    flex-direction: column;
}

.login-logo-name {
    font-size: 18px;
    font-weight: 700;
    color: #0a3d7a;
    letter-spacing: -0.3px;
    line-height: 1.1;
}

.login-logo-sub {
    font-size: 11px;
    color: #6b7c8d;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 500;
}

/* ─── Heading ────────────────────────────────────────────── */
.login-title {
    font-size: 26px;
    font-weight: 700;
    color: #1a2a3a;
    margin: 0 0 6px;
    letter-spacing: -0.5px;
}

.login-subtitle {
    font-size: 14px;
    color: #6b7c8d;
    margin: 0 0 32px;
    font-weight: 400;
    line-height: 1.5;
}

/* ─── Google button ──────────────────────────────────────── */
.btn-google {
    width: 100%;
    padding: 13px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fff;
    border: 1.5px solid #d0dbe6;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #1a2a3a;
    font-family: 'DM Sans', sans-serif;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    text-decoration: none;
}

.btn-google:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ─── Divider ────────────────────────────────────────────── */
.login-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 24px 0;
}

.login-divider-line {
    flex: 1;
    height: 1px;
    background: #d0dbe6;
}

.login-divider-text {
    font-size: 12px;
    color: #6b7c8d;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ─── Float-label inputs ─────────────────────────────────── */
.input-group-float {
    position: relative;
    margin-bottom: 16px;
}

.input-group-float input {
    width: 100%;
    padding: 22px 16px 8px;
    font-size: 15px;
    font-family: 'DM Sans', sans-serif;
    color: #1a2a3a;
    background: #f7fafc;
    border: 1.5px solid #d0dbe6;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
    box-sizing: border-box;
}

.input-group-float input:focus {
    background: #fff;
    border-color: #1565c0;
    box-shadow: 0 0 0 3px rgba(21,101,192,0.09);
}

.input-group-float label {
    position: absolute;
    left: 17px;
    top: 17px;
    font-size: 15px;
    color: #6b7c8d;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    transition: top 0.2s, font-size 0.2s, color 0.2s;
    pointer-events: none;
    letter-spacing: 0.2px;
}

/* Float up when focused or has value */
.input-group-float input:focus ~ label,
.input-group-float input:not(:placeholder-shown) ~ label {
    top: 7px;
    font-size: 11px;
}

.input-group-float input:focus ~ label {
    color: #1565c0;
}

/* Password input padding-right for eye button */
.input-group-float input[type="password"],
.input-group-float input.has-toggle {
    padding-right: 48px;
}

/* Eye toggle button */
.btn-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    opacity: 0.6;
    transition: opacity 0.2s;
    color: #6b7c8d;
}

.btn-eye:hover {
    opacity: 1;
}

/* ─── Forgot password link ───────────────────────────────── */
.login-forgot {
    text-align: right;
    margin-bottom: 24px;
    margin-top: -8px;
}

.login-forgot a {
    font-size: 13px;
    color: #1565c0;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.login-forgot a:hover {
    color: #0a3d7a;
}

/* ─── Submit button ──────────────────────────────────────── */
.btn-login {
    width: 100%;
    padding: 14px 16px;
    background: linear-gradient(135deg, #1565c0, #0a3d7a);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    letter-spacing: 0.3px;
    transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
    box-shadow: 0 3px 12px rgba(10,61,122,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login:hover:not(:disabled) {
    background: linear-gradient(135deg, #0a3d7a, #1565c0);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(10,61,122,0.40);
}

.btn-login:disabled {
    background: #1565c0;
    cursor: wait;
}

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

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

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

/* ─── Contact link ───────────────────────────────────────── */
.login-contact {
    text-align: center;
    margin-top: 28px;
    font-size: 13px;
    color: #6b7c8d;
}

.login-contact a {
    color: #1565c0;
    font-weight: 600;
    text-decoration: none;
    transition: text-decoration 0.2s;
}

.login-contact a:hover {
    text-decoration: underline;
}

/* ─── Footer copyright ───────────────────────────────────── */
.login-footer {
    position: absolute;
    bottom: 24px;
    font-size: 12px;
    color: rgba(107,124,141,0.6);
    letter-spacing: 0.3px;
    text-align: center;
    left: 0;
    right: 0;
}

/* ─── Error message ──────────────────────────────────────── */
.login-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #dc2626;
}

/* ─── Tablet adjustments ─────────────────────────────────── */
@media (min-width: 640px) and (max-width: 1023px) {
    .login-brand {
        padding: 40px 28px;
    }
    .login-brand-logo-box {
        width: 56px;
        height: 56px;
        border-radius: 14px;
        font-size: 22px;
    }
    .login-brand-headline {
        font-size: 24px;
    }
    .login-brand-sub {
        font-size: 13px;
    }
    .login-brand-pills {
        margin-top: 24px;
    }
    .login-brand-pill {
        font-size: 11px;
    }
    .login-form-panel {
        padding: 40px 24px;
    }
    .login-logo-box {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        font-size: 13px;
    }
    .login-logo {
        gap: 8px;
        margin-bottom: 28px;
    }
    .login-logo-name {
        font-size: 15px;
    }
    .login-logo-sub {
        font-size: 10px;
    }
}

/* ─── Mobile (<640px) ────────────────────────────────────── */
@media (max-width: 639px) {
    .login-page {
        flex-direction: column;
    }

    /* Compact branded header */
    .login-brand {
        flex: none;
        padding: 32px 24px 28px;
        text-align: center;
    }
    .login-brand .geom-square,
    .login-brand .geom-circle,
    .login-brand .geom-diamond {
        display: none;
    }
    .login-brand-content {
        max-width: 100%;
    }
    .login-brand-logo-box {
        width: 48px;
        height: 48px;
        border-radius: 12px;
        font-size: 18px;
        margin-bottom: 12px;
    }
    .login-brand-headline {
        font-size: 18px;
        font-weight: 700;
        margin: 0;
    }
    .login-brand-sub,
    .login-brand-pills {
        display: none;
    }
    /* Mobile: just name + tagline */
    .login-brand-name,
    .login-brand-tagline {
        display: block;
    }
    .login-brand-headline,
    .login-brand-sub,
    .login-brand-pills {
        display: none;
    }
    .login-brand-name {
        color: #fff;
        font-size: 18px;
        font-weight: 700;
        letter-spacing: -0.3px;
    }
    .login-brand-tagline {
        color: rgba(255,255,255,0.6);
        font-size: 12px;
        margin-top: 4px;
        letter-spacing: 1px;
        text-transform: uppercase;
        font-weight: 500;
    }

    /* Form panel becomes scrollable content area */
    .login-form-panel {
        flex: 1;
        padding: 28px 20px 24px;
        justify-content: flex-start;
        align-items: stretch;
    }
    .login-form-inner {
        max-width: 100%;
    }
    .login-logo {
        display: none;
    }
    .login-title {
        font-size: 22px;
    }
    .login-subtitle {
        font-size: 13px;
        margin-bottom: 24px;
    }
    .login-divider {
        margin: 20px 0;
    }
    .input-group-float {
        margin-bottom: 14px;
    }
    .input-group-float input {
        font-size: 16px; /* Prevents iOS auto-zoom */
        padding: 22px 14px 8px;
    }
    .input-group-float label {
        left: 15px;
        font-size: 16px;
    }
    .input-group-float input:focus ~ label,
    .input-group-float input:not(:placeholder-shown) ~ label {
        font-size: 11px;
        top: 7px;
    }
    .btn-login {
        padding: 13px 14px;
    }
    .login-footer {
        position: static;
        padding: 12px 20px 20px;
        font-size: 11px;
    }
}

/* Autofill del navegador : evit problemas de render si rellena automáticamente los campos */
.input-group-float input:-webkit-autofill ~ label,
.input-group-float input:autofill ~ label {
    top: 7px;
    font-size: 11px;
}