/* ========== VARIABLES (heretades del projecte) ========== */
:root {
    --color-primary: #2563eb;
    --color-primary-light: #3b82f6;
    --color-primary-dark: #1d4ed8;
    --color-bg: #f8fafc;
    --color-card: #ffffff;
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --border-radius: 24px;
}

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

body {
    font-family: 'Segoe UI', 'Arial', system-ui, sans-serif;
    color: #1e293b;
    min-height: 100vh;
}

/* ========== FONS ========== */
.login-bg {
    min-height: 100vh;
    width: 100%;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 50%, #1e3a8a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Bombolles decoratives de fons */
.login-bg::before,
.login-bg::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    pointer-events: none;
}

.login-bg::before {
    width: 400px;
    height: 400px;
    background: var(--color-primary);
    top: -100px;
    left: -100px;
}

.login-bg::after {
    width: 350px;
    height: 350px;
    background: var(--color-primary-light);
    bottom: -100px;
    right: -100px;
}

/* ========== TARGETA DE LOGIN ========== */
.login-card {
    background: var(--color-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 48px 40px 40px;
    width: 100%;
    max-width: 460px;
    position: relative;
    z-index: 1;
    text-align: center;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enllaç de tornada */
.back-link {
    position: absolute;
    top: 20px;
    left: 24px;
    color: #64748b;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--color-primary);
}

/* Logo */
.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.logo-circle {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.4);
}

.logo-circle svg {
    width: 36px;
    height: 36px;
}

/* Textos */
.login-title {
    font-size: 2.4rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.login-subtitle {
    font-size: 1.1rem;
    color: var(--color-primary);
    font-weight: 600;
    margin-bottom: 24px;
}

.login-instruction {
    font-size: 1rem;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 28px;
    padding: 0 8px;
}

/* Botó de Google */
.google-btn-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
    min-height: 44px;
}

/* Missatges d'estat */
.login-loading {
    color: var(--color-primary);
    font-size: 0.95rem;
    font-weight: 500;
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.95rem;
    margin-top: 16px;
    line-height: 1.4;
}

/* Spinner */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #cbd5e1;
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

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

/* Peu de pàgina de la targeta */
.login-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    font-size: 0.85rem;
    color: #94a3b8;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 480px) {
    .login-card {
        padding: 40px 24px 32px;
    }

    .login-title {
        font-size: 2rem;
    }

    .back-link {
        top: 16px;
        left: 16px;
    }
}