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

:root {
    --red: #e63946;
    --red-soft: #ff8fa3;
    --purple: #7b2cbf;
    --purple-soft: #c77dff;

    --body-bg-one: #ffd6e0;
    --body-bg-two: #d8c7ff;
    --body-bg-three: #fff7fb;
    --body-bg-four: #f7f0ff;
    --body-bg-five: #ffe8ef;

    --card-bg: rgba(255, 255, 255, 0.48);
    --card-border: rgba(255, 255, 255, 0.45);
    --card-light: rgba(255, 255, 255, 0.55);

    --input-bg: rgba(255, 255, 255, 0.72);
    --input-bg-focus: rgba(255, 255, 255, 0.95);
    --input-border: rgba(123, 44, 191, 0.14);

    --text-main: #35283f;
    --text-soft: #7c6b87;

    --button-secondary-bg: rgba(255, 255, 255, 0.48);
    --button-secondary-text: #7b2cbf;

    --shadow-card: rgba(82, 38, 120, 0.24);
    --shadow-input: rgba(123, 44, 191, 0.09);

    --orb-one: linear-gradient(135deg, #ffb3c6, #ffc8dd);
    --orb-two: linear-gradient(135deg, #c77dff, #e0aaff);
    --orb-three: linear-gradient(135deg, #ffccd5, #ffffff);

    color-scheme: light;
}

html[data-theme="dark"] {
    --body-bg-one: #4c0519;
    --body-bg-two: #3b0764;
    --body-bg-three: #100018;
    --body-bg-four: #190022;
    --body-bg-five: #07000d;

    --card-bg: rgba(24, 18, 35, 0.55);
    --card-border: rgba(255, 255, 255, 0.16);
    --card-light: rgba(255, 255, 255, 0.08);

    --input-bg: rgba(255, 255, 255, 0.09);
    --input-bg-focus: rgba(255, 255, 255, 0.14);
    --input-border: rgba(255, 255, 255, 0.13);

    --text-main: #fff5fb;
    --text-soft: #d9c6e7;

    --button-secondary-bg: rgba(255, 255, 255, 0.08);
    --button-secondary-text: #f5d9ff;

    --shadow-card: rgba(0, 0, 0, 0.45);
    --shadow-input: rgba(0, 0, 0, 0.2);

    --orb-one: linear-gradient(135deg, #7f1d1d, #e63946);
    --orb-two: linear-gradient(135deg, #581c87, #7b2cbf);
    --orb-three: linear-gradient(135deg, #be185d, #3b0764);

    color-scheme: dark;
}

body {
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text-main);
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 20%, var(--body-bg-one) 0%, transparent 30%),
        radial-gradient(circle at 80% 80%, var(--body-bg-two) 0%, transparent 34%),
        linear-gradient(135deg,
            var(--body-bg-three),
            var(--body-bg-four),
            var(--body-bg-five));
    transition: background 0.35s ease, color 0.35s ease;
}

.login-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Fondo animado */
.background {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(3px);
    opacity: 0.72;
    animation: floatOrb 8s ease-in-out infinite;
}

.orb-one {
    width: 260px;
    height: 260px;
    top: 8%;
    left: 12%;
    background: var(--orb-one);
}

.orb-two {
    width: 310px;
    height: 310px;
    right: 10%;
    bottom: 8%;
    background: var(--orb-two);
    animation-delay: 1.5s;
}

.orb-three {
    width: 180px;
    height: 180px;
    right: 28%;
    top: 16%;
    background: var(--orb-three);
    animation-delay: 3s;
}

.background::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.16) 1px, transparent 1px);
    background-size: 42px 42px;
    opacity: 0.28;
}

/* Tarjeta vidrio */
.login-card {
    position: relative;
    z-index: 1;
    width: 430px;
    padding: 25px 36px 30px;
    border-radius: 34px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow:
        0 30px 80px var(--shadow-card),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(26px);
    -webkit-backdrop-filter: blur(26px);
    overflow: hidden;
    animation: cardEnter 0.9s ease both;
    transition:
        background 0.35s ease,
        border 0.35s ease,
        box-shadow 0.35s ease;
}

.login-card::before {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 33px;
    background: linear-gradient(145deg,
            var(--card-light),
            rgba(255, 255, 255, 0.03));
    pointer-events: none;
}

.shine {
    position: absolute;
    top: -80px;
    left: -120px;
    width: 170px;
    height: 520px;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.38),
            transparent);
    transform: rotate(28deg);
    animation: shineMove 5s ease-in-out infinite;
}

.theme-switcher,
.brand,
.login-form,
.error-message,
.create-account {
    position: relative;
    z-index: 2;
}

/* Selector de tema */

/* Botón único de tema */
.theme-button {
    position: relative;
    z-index: 2;
    width: 170px;
    height: 58px;
    margin: 0 auto 24px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.34);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    cursor: pointer;
    overflow: hidden;
    box-shadow:
        0 14px 32px rgba(123, 44, 191, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition:
        background 0.35s ease,
        box-shadow 0.35s ease,
        transform 0.25s ease;
}

.theme-button:hover {
    transform: translateY(-2px);
}

.theme-button:active {
    transform: scale(0.97);
}

/* Fondo según modo */
html[data-theme-mode="light"] .theme-button {
    background: linear-gradient(135deg, #fff8d6, #ffd166, #ffc8dd);
}

html[data-theme-mode="system"] .theme-button {
    background: linear-gradient(135deg, #ffffff, #eadcff, #c77dff);
}

html[data-theme-mode="dark"] .theme-button {
    background: linear-gradient(135deg, #3b0764, #4361ee, #111827);
    box-shadow:
        0 14px 32px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

/* Bolita del switch */
.theme-knob {
    position: absolute;
    top: 7px;
    left: 7px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 25%, #ffffff, #f1f1f1 55%, #d7dbe5);
    box-shadow:
        0 8px 18px rgba(70, 45, 110, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition:
        transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        background 0.35s ease;
}

/* Posiciones de la bolita */
html[data-theme-mode="light"] .theme-knob {
    transform: translateX(0);
}

html[data-theme-mode="system"] .theme-knob {
    transform: translateX(56px);
}

html[data-theme-mode="dark"] .theme-knob {
    transform: translateX(112px);
    background:
        radial-gradient(circle at 30% 25%, #ffffff, #d8d8ff 50%, #9ca3ff);
}

/* Texto e icono */
.theme-info {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 900;
    color: #35283f;
    pointer-events: none;
    transition: color 0.35s ease;
}

html[data-theme-mode="dark"] .theme-info {
    color: white;
}

.theme-icon {
    font-size: 17px;
    line-height: 1;
}

.theme-text {
    font-size: 13px;
}

/* Responsive */
@media (max-width: 480px) {
    .theme-button {
        width: 155px;
        height: 54px;
        margin-bottom: 22px;
    }

    .theme-knob {
        width: 40px;
        height: 40px;
    }

    html[data-theme-mode="system"] .theme-knob {
        transform: translateX(51px);
    }

    html[data-theme-mode="dark"] .theme-knob {
        transform: translateX(102px);
    }

    .theme-text {
        font-size: 12px;
    }
}

/* Marca */
.brand {
    text-align: center;
    margin-bottom: 28px;
    animation: fadeUp 0.9s ease both;
}

.logo-circle {
    width: 128px;
    height: 128px;
    margin: 0 auto 15px;
    padding: 10px;
    border-radius: 50%;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 214, 224, 0.45)),
        linear-gradient(135deg, #fff, #e7d8ff);
    box-shadow:
        0 18px 35px rgba(123, 44, 191, 0.18),
        inset 0 0 0 1px rgba(255, 255, 255, 0.55);
    display: flex;
    justify-content: center;
    align-items: center;
    animation: logoPulse 3.5s ease-in-out infinite;
}

.logo {
    width: 105px;
    height: 105px;
    object-fit: contain;
}

.badge {
    display: inline-flex;
    padding: 7px 14px;
    margin-bottom: 12px;
    border-radius: 999px;
    color: var(--purple);
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(123, 44, 191, 0.16);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.4px;
}

html[data-theme="dark"] .badge {
    color: #ffd6e0;
    background: rgba(255, 255, 255, 0.08);
}

.brand h1 {
    color: var(--purple);
    font-size: 31px;
    font-weight: 900;
    letter-spacing: 0.4px;
    margin-bottom: 7px;
}

html[data-theme="dark"] .brand h1 {
    color: #f0c4ff;
}

.brand p {
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 700;
}

.brand span {
    color: var(--red);
}

/* Error */
.error-message {
    width: 100%;
    padding: 12px;
    margin-bottom: 18px;
    color: #a00020;
    background: rgba(255, 225, 232, 0.74);
    border: 1px solid rgba(230, 57, 70, 0.25);
    border-radius: 16px;
    font-size: 14px;
    text-align: center;
    font-weight: 700;
    animation: shake 0.35s ease;
}

html[data-theme="dark"] .error-message {
    color: #ffd6e0;
    background: rgba(230, 57, 70, 0.18);
}

/* Formulario */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    animation: fadeUp 1s ease both;
    animation-delay: 0.12s;
}

.login-form label {
    color: var(--text-main);
    font-size: 14px;
    font-weight: 900;
}

.login-form input {
    width: 100%;
    height: 48px;
    margin-top: 8px;
    padding: 0 16px;
    border: 1px solid var(--input-border);
    outline: none;
    border-radius: 17px;
    background: var(--input-bg);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
    box-shadow:
        0 10px 24px var(--shadow-input),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
    transition: 0.25s ease;
}

.login-form input::placeholder {
    color: var(--text-soft);
}

.login-form input:focus {
    border-color: rgba(199, 125, 255, 0.75);
    background: var(--input-bg-focus);
    box-shadow:
        0 0 0 5px rgba(199, 125, 255, 0.16),
        0 12px 28px rgba(123, 44, 191, 0.12);
    transform: translateY(-1px);
}

/* Password */
.password-box {
    position: relative;
}

.password-box input {
    padding-right: 52px;
}

.password-box button {
    position: absolute;
    right: 10px;
    top: 56%;
    transform: translateY(-50%);
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 50%;
    background: rgba(244, 233, 255, 0.95);
    cursor: pointer;
    font-size: 15px;
    box-shadow: 0 6px 14px rgba(123, 44, 191, 0.12);
    transition: 0.25s ease;
}

html[data-theme="dark"] .password-box button {
    background: rgba(255, 255, 255, 0.12);
}

.password-box button:hover {
    transform: translateY(-50%) scale(1.08);
}

/* Captcha */
.captcha-row {
    display: flex;
    gap: 11px;
    align-items: center;
}

.captcha-row input {
    flex: 1;
}

.captcha-image {
    width: 98px;
    height: 48px;
    margin-top: 8px;
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 214, 224, 0.88));
    border: 1px dashed rgba(230, 57, 70, 0.6);
    color: var(--purple);
    font-size: 24px;
    font-weight: 900;
    font-family: "Courier New", monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    letter-spacing: 2px;
    box-shadow: 0 10px 22px rgba(230, 57, 70, 0.12);
    text-shadow: 1px 1px 0 #ffc2d1;
    transform: rotate(-1.5deg);
    animation: captchaFloat 3s ease-in-out infinite;
}

html[data-theme="dark"] .captcha-image {
    background: rgba(255, 255, 255, 0.12);
    color: #ffd6e0;
    text-shadow: none;
}

/* Botón principal */
.login-button {
    height: 50px;
    margin-top: 10px;
    border: none;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--red), var(--purple-soft), var(--purple));
    color: white;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow:
        0 16px 28px rgba(230, 57, 70, 0.24),
        0 10px 24px rgba(123, 44, 191, 0.18);
    transition: 0.25s ease;
    position: relative;
    overflow: hidden;
}

.login-button::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.35),
            transparent);
    transform: translateX(-100%);
    transition: 0.45s ease;
}

.login-button:hover::before {
    transform: translateX(100%);
}

.login-button:hover {
    transform: translateY(-3px);
}

.login-button:active {
    transform: scale(0.98);
}

/* Crear cuenta */
.create-account {
    width: 100%;
    margin-top: 18px;
    padding: 14px;
    display: block;
    text-align: center;
    text-decoration: none;
    color: var(--button-secondary-text);
    background: var(--button-secondary-bg);
    border: 1px solid var(--input-border);
    border-radius: 17px;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 10px 24px var(--shadow-input);
    transition: 0.25s ease;
    animation: fadeUp 1s ease both;
    animation-delay: 0.22s;
}

.create-account:hover {
    color: white;
    background: linear-gradient(135deg, var(--purple), var(--purple-soft));
    transform: translateY(-2px);
}

/* Animaciones */
@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }

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

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

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

@keyframes floatOrb {

    0%,
    100% {
        transform: translateY(0) translateX(0) scale(1);
    }

    50% {
        transform: translateY(-28px) translateX(18px) scale(1.05);
    }
}

@keyframes shineMove {
    0% {
        left: -160px;
        opacity: 0;
    }

    35% {
        opacity: 0.6;
    }

    70% {
        left: 115%;
        opacity: 0;
    }

    100% {
        left: 115%;
        opacity: 0;
    }
}

@keyframes logoPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.035);
    }
}

@keyframes captchaFloat {

    0%,
    100% {
        transform: rotate(-1.5deg) translateY(0);
    }

    50% {
        transform: rotate(1.5deg) translateY(-2px);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    30% {
        transform: translateX(-5px);
    }

    60% {
        transform: translateX(5px);
    }
}

/* Responsive */
@media (max-width: 480px) {
    body {
        overflow-y: auto;
    }

    .login-page {
        padding: 24px 0;
    }

    .login-card {
        width: 90%;
        padding: 22px 22px 24px;
        border-radius: 28px;
    }

    .theme-switcher {
        margin-bottom: 22px;
    }

    .theme-switcher button {
        font-size: 11px;
    }

    .brand h1 {
        font-size: 27px;
    }

    .logo-circle {
        width: 112px;
        height: 112px;
    }

    .logo {
        width: 92px;
        height: 92px;
    }

    .captcha-image {
        width: 86px;
        font-size: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* Página de registro */
.register-card {
    width: 455px;
}

.register-card .brand {
    margin-bottom: 22px;
}

.register-card .logo-circle {
    width: 105px;
    height: 105px;
}

.register-card .logo {
    width: 86px;
    height: 86px;
}

.register-card .brand h1 {
    font-size: 29px;
}

.register-card .login-form {
    gap: 15px;
}

.register-card .login-form input {
    height: 46px;
}

.register-card .captcha-image {
    height: 46px;
}

.register-card .login-button {
    margin-top: 6px;
}

/* Para que el registro no se corte en pantallas pequeñas */
@media (max-height: 850px) {
    body {
        overflow-y: auto;
    }

    .login-page {
        padding: 28px 0;
    }
}

@media (max-width: 480px) {
    .register-card {
        width: 90%;
    }

    .register-card .logo-circle {
        width: 96px;
        height: 96px;
    }

    .register-card .logo {
        width: 78px;
        height: 78px;
    }
}
/* ==========================================================
   DATADOX LOGIN RESPONSIVE ADD-ON
   ========================================================== */
@media (max-width: 720px) {
  body {
    overflow-y: auto !important;
  }

  .login-page {
    min-height: 100svh !important;
    padding: 18px 12px !important;
    align-items: flex-start !important;
  }

  .login-card,
  .register-card {
    width: 100% !important;
    max-width: 430px !important;
    min-height: auto !important;
    padding: 24px 18px !important;
    border-radius: 28px !important;
  }

  .brand h1 {
    font-size: clamp(32px, 12vw, 52px) !important;
  }

  .login-form {
    gap: 14px !important;
  }

  .login-form input,
  .password-box,
  .captcha-box {
    min-width: 0 !important;
  }

  .theme-toggle,
  .theme-button {
    max-width: 100% !important;
  }
}

@media (max-width: 420px) {
  .login-card,
  .register-card {
    padding: 20px 14px !important;
    border-radius: 24px !important;
  }

  .brand p {
    font-size: 13px !important;
  }
}
