/* ===== Tokens ===== */
:root {
    --bg: #121212;
    --brand: #ffc107;
    --brand-d: #e0ab06;
    --txt: #ffffff;
    --muted: #d6d6d6;
    --err: #d10f2f;
    --ok: #2aa84a;
    --card: #1b1b1b;
    --shadow-lg: 0 22px 60px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 12px 34px rgba(0, 0, 0, 0.38);
}

/* ===== Base ===== */
* {
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
}
body {
    background: url("https://res.cloudinary.com/dqcaqvplr/image/upload/v1740396560/rdeprhfbimjhxbqg9xih.png")
        no-repeat center center fixed;
    background-size: cover;
    color: var(--txt);
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial,
        sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
}
body::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.55),
        rgba(0, 0, 0, 0.35)
    );
    z-index: -1;
}
@media (max-width: 640px) {
    body {
        background-attachment: scroll;
    }
}

/* ===== Header (container-aware) ===== */
header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(8px, 2cqw, 20px);
    min-height: clamp(64px, 8vw, 100px);
    padding-block: clamp(10px, 2cqw, 18px);
    container-type: inline-size;
    background: var(--brand);
    color: #000;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.logo {
    position: absolute;
    top: 50%;
    left: clamp(10px, 2cqw, 22px);
    transform: translateY(-50%);
    width: clamp(44px, 7cqw, 92px);
    height: clamp(44px, 7cqw, 92px);
    object-fit: contain;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.35));
    transition: transform 0.18s ease;
}
.logo:hover {
    transform: translateY(-50%) scale(1.03);
}
h1 {
    margin: 0;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1.12;
    font-size: clamp(20px, 4.4cqw, 36px);
    background: linear-gradient(90deg, #000, #3b3b3b);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 0.3px;
}

/* Fallback */
@supports not (container-type: inline-size) {
    header {
        padding-block: clamp(10px, 2.6vw, 18px);
    }
    .logo {
        left: clamp(10px, 3vw, 22px);
        width: clamp(44px, 10vw, 92px);
        height: clamp(44px, 10vw, 92px);
    }
    h1 {
        font-size: clamp(22px, 5vw, 36px);
    }
}

/* ===== Layout spacing (more in mobile) ===== */
main.container {
    padding-block: clamp(36px, 6vw, 80px);
}
@media (max-width: 480px) {
    main.container {
        padding-block: clamp(48px, 12vw, 96px);
    }
}

/* ===== Signup card (modern & interactive) ===== */
.signup-container {
    position: relative;
    background: var(--brand);
    color: #000;
    border-radius: 18px;
    padding: clamp(22px, 4.2vw, 32px);
    max-width: 400px;
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: var(--shadow-md);
    transition: transform 0.18s ease, box-shadow 0.24s ease;
    isolation: isolate;
}
/* Animated accent border (accessible) */
.signup-container::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 20px;
    padding: 1px;
    background: conic-gradient(
        from var(--angle, 0deg),
        #ffd54a,
        #ffb300,
        #ffd54a
    );
    -webkit-mask: linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: spin 6s linear infinite;
    opacity: 0.7;
    pointer-events: none;
}
@keyframes spin {
    to {
        --angle: 360deg;
    }
}
.signup-container:focus-within {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Form grid */
.signup-container form {
    display: grid;
    gap: clamp(12px, 3vw, 18px);
}

/* ===== Inputs with inline icons (no HTML changes) ===== */
.signup-container .form-control {
    border-radius: 14px;
    padding: 12px 14px 12px 46px; /* space for icon */
    border: 2px solid rgba(0, 0, 0, 0.18);
    background: #fff;
    color: #000;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.08s;
    background-repeat: no-repeat;
    background-position: 14px center;
    background-size: 18px 18px;
}
/* Per-field icons via IDs */
#nombre {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="%23000"><path d="M9 9a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm0 2C5.686 11 3 13.239 3 16v1h12v-1c0-2.761-2.686-5-6-5Z"/></svg>');
}
#apellidos {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="%23000"><path d="M3 14s1-1 6-1 6 1 6 1v2H3v-2Zm6-3a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z"/></svg>');
}
#email {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="%23000"><path d="M20 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2Zm0 3.2-8 5.3-8-5.3V7l8 5.3L20 7v1.2Z"/></svg>');
}

#password {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="%23000"><path d="M5 8V6a4 4 0 1 1 8 0v2h1a1 1 0 0 1 1 1v7H3V9a1 1 0 0 1 1-1h1Zm2 0h4V6a2 2 0 1 0-4 0v2Z"/></svg>');
}
#telefono {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="%23000"><path d="M3 2h4l1 3-2 1a10 10 0 0 0 5 5l1-2 3 1v4a1 1 0 0 1-1 1C8.82 15 3 9.18 3 2a1 1 0 0 1 1-1Z"/></svg>');
}

/* Hover/Focus microinteractions (subtle) */
.signup-container .form-control:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
}
.signup-container .form-control:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.18), 0 14px 28px rgba(0, 0, 0, 0.28);
}

/* Native validation (only after typing) */
.signup-container .form-control:not(:placeholder-shown):invalid {
    border-color: var(--err);
    box-shadow: 0 0 0 3px rgba(209, 15, 47, 0.18);
    animation: nudge 0.24s ease;
}
@keyframes nudge {
    0%,
    100% {
        transform: none;
    }
    50% {
        transform: translateX(1.5px);
    }
}
.signup-container .form-control:not(:placeholder-shown):valid {
    border-color: var(--ok);
    box-shadow: 0 0 0 3px rgba(42, 168, 74, 0.18);
}

/* ===== CTA ===== */
.signup-container .btn {
    position: relative;
    display: inline-block;
    padding: 12px 18px;
    border-radius: 14px;
    font-weight: 900;
    letter-spacing: 0.25px;
    border: none;
    color: #fff;
    background: #000;
    transition: transform 0.12s, box-shadow 0.22s, background-color 0.2s;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
    overflow: hidden;
}
.signup-container .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
    background: #111;
}
.signup-container .btn:active {
    transform: translateY(0) scale(0.98);
}
.signup-container .btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.35);
}
/* Soft ripple */
.signup-container .btn::after {
    content: "";
    position: absolute;
    inset: -20%;
    background: radial-gradient(
        circle at 50% 50%,
        rgba(255, 255, 255, 0.22),
        transparent 48%
    );
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.32s ease, transform 0.32s ease;
    pointer-events: none;
}
.signup-container .btn:active::after {
    opacity: 1;
    transform: scale(1.1);
}

/* Alerts */
.alert {
    border-radius: 14px;
}
.alert-success {
    border: 1px solid rgba(0, 0, 0, 0.12);
}

/* Motion-safe */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
    .signup-container {
        transform: none !important;
    }
}
