/* Base y tema */
:root {
    /* Toma la paleta base del index */
    --primary-color: #198daa;
    --secondary-color: #90d3ff;
    --accent-color: #e74c3c;
    --light-bg: #ecf0f1;
    --dark-bg: #34495e;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --border-radius: 12px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.12);

    /* Derivados para el login */
    --bg: #f7f9fc;
    --bg-2: #eef3f8;
    --text: var(--text-dark);
    --muted: var(--text-light);
    --card: rgba(255, 255, 255, 0.9);
    --card-border: rgba(0, 0, 0, 0.08);
    --primary: var(--primary-color);
    --primary-2: var(--secondary-color);
    --accent: var(--secondary-color);
    --danger: var(--accent-color);
    /* Dorado */
    --gold: var(--warning-color, #f4c542);
    --gold-2: #e6a73e;
    --gold-rgb: 244, 197, 66;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    color: var(--text);
    background: radial-gradient(1200px 800px at 10% 10%, #ffffff 0%, var(--bg) 40%, var(--bg-2) 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Layout dividido */
.split {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.split-left {
    position: relative;
    padding: 64px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: radial-gradient(800px 600px at 20% 20%, rgba(144, 211, 255, 0.35) 0%, rgba(44, 62, 80, 0.18) 35%, transparent 65%),
        radial-gradient(600px 500px at 80% 80%, rgba(44, 62, 80, 0.12), transparent 60%);
}

.logo {
    width: 400px;
    height: 200px;
    background-image: url('../img/logo.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    margin-top: 20px;
}

.brand {
    font-weight: 700;
    font-size: 39px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary-color);
    opacity: 0;
    animation: fade-in 800ms ease 80ms forwards;
}

.brand::after {
    content: "";
    display: block;
    width: 64px;
    height: 3px;
    margin-top: 10px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--gold), transparent);
    opacity: 0;
    transform: translateY(6px);
    animation: slide-up 700ms ease 220ms forwards;
}

.headline {
    margin: 12px 0 8px;
    font-size: 25px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    opacity: 0;
    transform: translateY(8px);
    animation: slide-up 900ms cubic-bezier(.2, .7, .2, 1) 160ms forwards;
}

.subtitle {
    margin: 0;
    font-size: 16px;
    color: var(--muted);
    max-width: 520px;
    opacity: 0;
    transform: translateY(6px);
    animation: slide-up 900ms cubic-bezier(.2, .7, .2, 1) 270ms forwards;
}

.shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.blob {
    position: absolute;
    filter: blur(22px);
    opacity: 0.45;
    mix-blend-mode: screen;
    transform: translate3d(0, 0, 0);
}

.blob-1 {
    width: 380px;
    height: 380px;
    left: -60px;
    top: -60px;
    background: radial-gradient(circle at 30% 30%, var(--primary), transparent 60%),
        radial-gradient(circle at 70% 70%, var(--accent), transparent 65%);
    border-radius: 50%;
    animation: float-1 14s ease-in-out infinite;
}

.blob-2 {
    width: 460px;
    height: 460px;
    right: -120px;
    bottom: -120px;
    background: radial-gradient(circle at 30% 70%, var(--primary-2), transparent 60%),
        radial-gradient(circle at 80% 20%, var(--primary), transparent 65%);
    border-radius: 50%;
    animation: float-2 18s ease-in-out infinite;
}

.blob-3 {
    width: 220px;
    height: 220px;
    left: 40%;
    bottom: 18%;
    background: radial-gradient(circle at 50% 50%, rgba(var(--gold-rgb), 0.35), transparent 62%),
        radial-gradient(circle at 50% 50%, var(--accent), transparent 60%);
    border-radius: 50%;
    animation: float-3 16s ease-in-out infinite;
}

.split-right {
    display: grid;
    place-items: center;
    padding: 32px;
}

.card {
    width: min(420px, 96%);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 28px;
    margin-top: 20%;
    box-shadow: var(--shadow);
    transform: translateY(8px);
    opacity: 0;
    animation: slide-up 800ms cubic-bezier(.2, .7, .2, 1) 220ms forwards;
    position: relative;
}

.card-title {
    margin: 0 0 18px;
    font-size: 24px;
    letter-spacing: -0.01em;
}

.card-title::after {
    content: "";
    display: block;
    width: 56px;
    height: 3px;
    margin-top: 10px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--gold), var(--gold-2));
    opacity: 0.9;
}

form {
    margin: 0;
}

.field {
    position: relative;
    margin-bottom: 18px;
}

.field input {
    width: 100%;
    padding: 14px 44px 14px 14px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.85);
    color: var(--text);
    outline: none;
    transition: border-color 200ms ease, box-shadow 200ms ease, background 200ms ease;
}

.field input::placeholder {
    color: transparent;
}

.field label {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    background: transparent;
    padding: 0 6px;
    pointer-events: none;
    transition: transform 200ms ease, color 200ms ease, top 200ms ease, background 200ms ease;
}

.field input:focus {
    border-color: rgba(var(--gold-rgb), 0.8);
    box-shadow: 0 0 0 2px rgba(var(--gold-rgb), 0.30), 0 0 0 6px rgba(144, 211, 255, 0.18);
    background: #fff;
}

.field input:focus+label,
.field input:not(:placeholder-shown)+label {
    top: -12px;
    transform: translateY(0) scale(0.90);
    color: var(--gold);
    background: var(--bg);
    padding: 0 6px;
    border-radius: 6px;
    z-index: 1;
    box-shadow: 0 0 0 2px var(--bg);
}

.password-field {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    height: 36px;
    width: 36px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    display: grid;
    place-items: center;
    color: var(--primary-color);
    background: transparent;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, transform 120ms ease;
}

.toggle-password:hover {
    background: rgba(var(--gold-rgb), 0.10);
    border-color: rgba(var(--gold-rgb), 0.35);
}

.toggle-password:active {
    transform: translateY(-50%) scale(0.98);
}

.toggle-password .icon-eye {
    opacity: 0.95;
}

.toggle-password.revealed .icon-eye {
    color: var(--gold);
}

.btn {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    border: 0;
    border-radius: 12px;
    padding: 14px 16px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 0 0 1px rgba(var(--gold-rgb), 0.25), 0 8px 24px rgba(44, 62, 80, 0.20), 0 2px 8px rgba(144, 211, 255, 0.18);
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 200ms ease, filter 200ms ease;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 0 1px rgba(var(--gold-rgb), 0.32), 0 12px 30px rgba(44, 62, 80, 0.24), 0 6px 16px rgba(144, 211, 255, 0.22);
}

.btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(var(--gold-rgb), 0.32), transparent);
    transition: left 0.5s;
    pointer-events: none;
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: translateY(0);
    filter: brightness(0.98);
}

.credit {
    margin-top: 18px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}

/* Extras bajo el botón */
.form-extras {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
}

.remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    user-select: none;
}

.remember input[type="checkbox"] {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    accent-color: var(--primary-color);
}

.forgot {
    color: var(--primary-color);
    text-decoration: none;
}

.forgot:hover {
    color: var(--gold);
    text-decoration: underline;
}

/* Animaciones */
@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes float-1 {

    0%,
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    50% {
        transform: translate3d(18px, -12px, 0) scale(1.05);
    }
}

@keyframes float-2 {

    0%,
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    50% {
        transform: translate3d(-22px, 16px, 0) scale(1.07);
    }
}

@keyframes float-3 {

    0%,
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    50% {
        transform: translate3d(0, -20px, 0) scale(0.96);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .headline {
        font-size: 40px;
    }
}

@media (max-width: 900px) {
    .split {
        grid-template-columns: 1fr;
    }

    .split-left {
        padding: 40px 24px 8px;
        min-height: 40vh;
    }

    .split-right {
        padding: 16px;
    }

    .headline {
        font-size: 36px;
    }
}

@media (max-width: 520px) {
    .headline {
        font-size: 30px;
    }

    .card {
        padding: 22px;
    }

    .field input {
        padding: 12px 40px 12px 12px;
    }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}