* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --gold: #D4AF37;
    --dark-gold: #B8941F;
    --light-gold: #F4E4B8;
    --charcoal: #2C3539;
    --deep-navy: #1a1d23;
    --cream: #F5F1E8;
    --success: #4CAF50;
    --error: #f44336;
    --warning: #ff9800;
}

body {
    font-family: 'Cormorant Garamond', serif;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    background: #000000 !important;
}

/* ============================================ */
/* FONDO TOTALMENTE NEGRO */
/* ============================================ */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
    background: #000000;
}

/* Ocultar completamente la imagen */
.bg-image {
    display: none;
}

/* Overlay negro sólido */
.video-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    z-index: 1;
}

/* Eliminar ornamentos de fondo */
.bg-ornament {
    display: none;
}

/* Welcome Screen - Fondo negro */
.welcome-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeOutWelcome 1s ease-in-out 3.5s forwards;
}

@keyframes fadeOutWelcome {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

.welcome-logo {
    width: min(200px, 40vw);
    height: min(200px, 40vw);
    margin-bottom: clamp(15px, 5vh, 30px);
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--gold);
    box-shadow: 0 0 60px rgba(212, 175, 55, 0.6);
    animation: zoomInLogo 1.5s ease-out forwards;
}

@keyframes zoomInLogo {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.welcome-logo video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.welcome-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(2rem, 8vw, 5rem);
    font-weight: 700;
    color: var(--gold);
    letter-spacing: clamp(4px, 1.5vw, 8px);
    text-transform: uppercase;
    margin-bottom: clamp(10px, 2vh, 15px);
    opacity: 0;
    animation: fadeInSlideUp 1s ease-out 0.5s forwards;
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.7);
    text-align: center;
    padding: 0 15px;
}

.welcome-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1rem, 3vw, 2rem);
    color: var(--light-gold);
    letter-spacing: clamp(3px, 1vw, 6px);
    font-weight: 300;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeInSlideUp 1s ease-out 1s forwards;
    text-align: center;
    padding: 0 15px;
}

@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-ornament {
    width: min(150px, 30vw);
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: clamp(20px, 5vh, 30px) 0;
    opacity: 0;
    animation: expandLine 1s ease-out 1.5s forwards;
}

@keyframes expandLine {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: min(150px, 30vw);
        opacity: 1;
    }
}

.welcome-tagline {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(0.85rem, 2.5vw, 1.2rem);
    color: var(--cream);
    font-style: italic;
    opacity: 0;
    animation: fadeIn 1s ease-out 2s forwards;
    text-align: center;
    padding: 0 15px;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* Particles - Opcional, se pueden eliminar si no se usan */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: var(--gold);
    border-radius: 50%;
    opacity: 0;
    animation: rise 15s linear infinite;
}

@keyframes rise {
    0% {
        bottom: -10px;
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.1;
    }
    100% {
        bottom: 100%;
        opacity: 0;
    }
}

/* Main Content - Responsive */
.main-content {
    opacity: 0;
    animation: showMainContent 1s ease-out 4s forwards;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(10px, 3vh, 20px);
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
}

@keyframes showMainContent {
    to {
        opacity: 1;
    }
}

/* Login Container - Fondo semitransparente sobre negro */
.login-container {
    position: relative;
    width: 100%;
    max-width: min(480px, 90%);
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid var(--gold);
    border-radius: clamp(8px, 2vw, 12px);
    padding: clamp(25px, 5vw, 60px) clamp(20px, 5vw, 50px);
    box-shadow: 0 0 60px rgba(212, 175, 55, 0.3), inset 0 0 80px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
    opacity: 0;
    animation: fadeInContainer 0.8s ease-out 4.2s forwards;
    margin: auto;
}

@keyframes fadeInContainer {
    to {
        opacity: 1;
    }
}

/* Corner Ornaments */
.corner-ornament {
    position: absolute;
    width: clamp(30px, 8vw, 60px);
    height: clamp(30px, 8vw, 60px);
    border: 2px solid var(--gold);
    opacity: 0;
}

.corner-ornament::before,
.corner-ornament::after {
    content: '';
    position: absolute;
    background: var(--gold);
}

.corner-ornament::before {
    width: clamp(12px, 3vw, 20px);
    height: 2px;
}

.corner-ornament::after {
    width: 2px;
    height: clamp(12px, 3vw, 20px);
}

.corner-top-left {
    top: -2px;
    left: -2px;
    border-right: none;
    border-bottom: none;
    animation: slideInCorner 0.8s ease-out 4.5s forwards;
}

.corner-top-left::before { top: -2px; left: -2px; }
.corner-top-left::after { top: -2px; left: -2px; }

.corner-top-right {
    top: -2px;
    right: -2px;
    border-left: none;
    border-bottom: none;
    animation: slideInCorner 0.8s ease-out 4.6s forwards;
}

.corner-top-right::before { top: -2px; right: -2px; }
.corner-top-right::after { top: -2px; right: -2px; }

.corner-bottom-left {
    bottom: -2px;
    left: -2px;
    border-right: none;
    border-top: none;
    animation: slideInCorner 0.8s ease-out 4.7s forwards;
}

.corner-bottom-left::before { bottom: -2px; left: -2px; }
.corner-bottom-left::after { bottom: -2px; left: -2px; }

.corner-bottom-right {
    bottom: -2px;
    right: -2px;
    border-left: none;
    border-top: none;
    animation: slideInCorner 0.8s ease-out 4.8s forwards;
}

.corner-bottom-right::before { bottom: -2px; right: -2px; }
.corner-bottom-right::after { bottom: -2px; right: -2px; }

@keyframes slideInCorner {
    to { opacity: 0.6; }
}

/* Logo Container */
.logo-container {
    text-align: center;
    margin-bottom: clamp(15px, 4vh, 40px);
    opacity: 0;
    transform: translateY(-20px);
    animation: fadeInLogo 1s ease-out 4.9s forwards;
}

@keyframes fadeInLogo {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-shield {
    width: min(180px, 40vw);
    height: auto;
    margin: 0 auto clamp(15px, 3vh, 20px);
    position: relative;
    filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.5));
    animation: glow 3s ease-in-out infinite alternate;
    border-radius: 10px;
    overflow: hidden;
}

@keyframes glow {
    from { filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.3)); }
    to { filter: drop-shadow(0 0 35px rgba(212, 175, 55, 0.7)); }
}

.logo-shield .logo-video {
    width: 100%;
    height: auto;
    display: block;
}

.logo-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.3rem, 6vw, 2.2rem);
    font-weight: 700;
    color: var(--gold);
    letter-spacing: clamp(2px, 1.5vw, 4px);
    text-transform: uppercase;
    margin-bottom: 5px;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

.logo-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(0.75rem, 2.5vw, 1rem);
    color: var(--light-gold);
    letter-spacing: clamp(1.5px, 1vw, 3px);
    font-weight: 300;
    text-transform: uppercase;
}

/* Divider */
.divider {
    width: min(100px, 20vw);
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: clamp(15px, 3vh, 30px) auto;
    opacity: 0;
    animation: expandDivider 1s ease-out 5.1s forwards;
}

@keyframes expandDivider {
    from { width: 0; opacity: 0; }
    to { width: min(100px, 20vw); opacity: 1; }
}

/* Form Groups */
.form-group {
    margin-bottom: clamp(15px, 3vh, 30px);
    opacity: 0;
    transform: translateX(-30px);
}

.form-group:nth-child(1) {
    animation: slideInForm 0.6s ease-out 5.3s forwards;
}

.form-group:nth-child(2) {
    animation: slideInForm 0.6s ease-out 5.5s forwards;
}

@keyframes slideInForm {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: clamp(0.7rem, 2vw, 0.85rem);
    color: var(--light-gold);
    margin-bottom: 8px;
    letter-spacing: clamp(1px, 0.3vw, 2px);
    text-transform: uppercase;
    font-weight: 600;
}

/* Input Wrapper */
.input-wrapper {
    position: relative;
    width: 100%;
}

.input-icon {
    position: absolute;
    left: clamp(12px, 2vw, 15px);
    top: 50%;
    transform: translateY(-50%);
    width: clamp(20px, 4vw, 24px);
    height: clamp(20px, 4vw, 24px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    pointer-events: none;
}

.input-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: var(--gold);
    stroke-width: 1.5;
    transition: all 0.3s ease;
}

input {
    width: 100%;
    padding: clamp(10px, 2vh, 16px) clamp(12px, 3vw, 20px) clamp(10px, 2vh, 16px) clamp(45px, 10vw, 60px);
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 4px;
    color: var(--cream);
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    transition: all 0.4s ease;
    outline: none;
}

input::placeholder {
    color: rgba(245, 241, 232, 0.4);
    font-style: italic;
    font-size: clamp(0.8rem, 2vw, 0.95rem);
}

input:focus {
    border-color: var(--gold);
    background: rgba(0, 0, 0, 0.7);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

input:focus ~ .input-icon svg {
    stroke: var(--light-gold);
    transform: scale(1.1);
}

input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Login Button */
.btn-login {
    width: 100%;
    padding: clamp(12px, 2.5vh, 18px);
    background: linear-gradient(135deg, var(--gold) 0%, var(--dark-gold) 100%);
    border: none;
    border-radius: 4px;
    color: #000000;
    font-family: 'Cinzel', serif;
    font-size: clamp(0.85rem, 2.5vw, 1.1rem);
    font-weight: 700;
    letter-spacing: clamp(1px, 0.5vw, 3px);
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    animation: slideInButton 0.6s ease-out 5.9s forwards;
}

@keyframes slideInButton {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-login:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.4);
}

.btn-login:hover:not(:disabled)::before {
    width: 300px;
    height: 300px;
}

.btn-login:active {
    transform: translateY(-1px);
}

.btn-text {
    position: relative;
    z-index: 1;
}

/* Intent Counter */
.intent-counter {
    text-align: center;
    margin-top: clamp(10px, 2vh, 15px);
    font-size: clamp(0.75rem, 2vw, 0.85rem);
    color: var(--light-gold);
    opacity: 0.7;
    padding: clamp(5px, 1.5vh, 8px);
    border-radius: 6px;
}

.intent-counter.warning {
    background: rgba(255, 152, 0, 0.2);
    color: var(--warning);
    opacity: 1;
    border: 1px solid var(--warning);
}

.intent-counter.danger {
    background: rgba(244, 67, 54, 0.2);
    color: var(--error);
    opacity: 1;
    font-weight: bold;
    border: 1px solid var(--error);
}

.intent-counter small {
    font-size: clamp(0.65rem, 1.5vw, 0.75rem);
}

/* Blocked Message */
.blocked-message {
    text-align: center;
    margin-top: clamp(15px, 3vh, 20px);
    padding: clamp(10px, 2vh, 15px);
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid var(--error);
    border-radius: 8px;
    color: #ff6b6b;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
}

.blocked-message small {
    font-size: clamp(0.7rem, 1.8vw, 0.8rem);
}

/* Message Container */
.message-container {
    position: fixed;
    top: clamp(10px, 2vh, 20px);
    right: clamp(10px, 2vw, 20px);
    z-index: 10000;
    width: min(400px, calc(100% - 40px));
    max-width: 400px;
}

.message {
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid;
    border-radius: 8px;
    padding: clamp(12px, 2vh, 15px) clamp(15px, 3vw, 20px);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: clamp(8px, 2vw, 12px);
    animation: slideInRight 0.3s ease-out;
    backdrop-filter: blur(10px);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.message.success {
    border-color: var(--success);
    color: #d4edda;
}

.message.error {
    border-color: var(--error);
    color: #f8d7da;
}

.message-icon {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    flex-shrink: 0;
}

.message-content {
    flex: 1;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(0.85rem, 2.5vw, 1rem);
    word-break: break-word;
}

.close-message {
    background: none;
    border: none;
    color: inherit;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    cursor: pointer;
    padding: 0 5px;
    opacity: 0.7;
    transition: opacity 0.3s;
    flex-shrink: 0;
}

.close-message:hover {
    opacity: 1;
}

/* Scissors */
.scissors {
    position: absolute;
    bottom: clamp(10px, 2vh, 20px);
    right: clamp(10px, 2vw, 20px);
    font-size: clamp(1.2rem, 4vw, 2rem);
    color: var(--gold);
    opacity: 0.2;
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Loading State */
.loading {
    pointer-events: none;
}

.loading .btn-text::after {
    content: '';
    position: absolute;
    right: -30px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid #000000;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* Vista Button */
.vista-btn {
    position: fixed;
    top: clamp(15px, 3vh, 20px);
    right: clamp(15px, 3vw, 20px);
    z-index: 1000;
    background: linear-gradient(135deg, #d4af37, #b8942c);
    color: #1a1a1a;
    border: none;
    padding: clamp(8px, 2vh, 12px) clamp(16px, 3vw, 24px);
    border-radius: 30px;
    font-size: clamp(12px, 2.5vw, 16px);
    font-weight: 600;
    font-family: 'Cinzel', serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: clamp(4px, 1.5vw, 8px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    text-decoration: none;
    white-space: nowrap;
}

.vista-btn i {
    font-size: clamp(12px, 2.5vw, 18px);
}

.vista-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    background: linear-gradient(135deg, #e5c158, #c4a032);
    color: #000;
}

.vista-btn:active {
    transform: translateY(0);
}

/* ============================================ */
/* MEDIA QUERIES RESPONSIVE */
/* ============================================ */

/* Tablets y móviles grandes (768px) */
@media (max-width: 768px) {
    .login-container {
        max-width: 95%;
        padding: 30px 25px;
    }
    
    .welcome-logo {
        width: 130px;
        height: 130px;
    }
    
    .message-container {
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
    }
    
    .corner-ornament {
        width: 30px;
        height: 30px;
    }
    
    .corner-ornament::before {
        width: 12px;
    }
    
    .corner-ornament::after {
        height: 12px;
    }
}

/* Móviles pequeños (480px) */
@media (max-width: 480px) {
    .login-container {
        border-radius: 8px;
        padding: 20px;
    }
    
    .corner-ornament {
        width: 25px;
        height: 25px;
    }
    
    .welcome-title {
        letter-spacing: 3px;
    }
    
    .welcome-subtitle {
        letter-spacing: 2px;
    }
    
    .logo-shield {
        width: 100px;
    }
    
    .divider {
        width: 60px;
    }
    
    .vista-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .vista-btn i {
        font-size: 11px;
    }
    
    .input-icon {
        left: 10px;
        width: 18px;
        height: 18px;
    }
    
    input {
        padding-left: 38px;
    }
}

/* Móviles muy pequeños (375px) */
@media (max-width: 375px) {
    .login-container {
        padding: 20px 15px;
    }
    
    .logo-title {
        font-size: 1.2rem;
    }
    
    .logo-subtitle {
        font-size: 0.7rem;
    }
    
    .btn-login {
        padding: 10px;
        font-size: 0.8rem;
    }
    
    .intent-counter {
        font-size: 0.7rem;
    }
}

/* Pantallas grandes (1200px+) */
@media (min-width: 1200px) {
    .login-container {
        max-width: 500px;
    }
    
    .welcome-logo {
        width: 220px;
        height: 220px;
    }
}

/* Pantallas muy grandes (1600px+) */
@media (min-width: 1600px) {
    .login-container {
        max-width: 550px;
        padding: 70px 60px;
    }
    
    .welcome-logo {
        width: 250px;
        height: 250px;
    }
    
    .logo-shield {
        width: 200px;
    }
    
    .logo-title {
        font-size: 2.5rem;
    }
    
    .logo-subtitle {
        font-size: 1.2rem;
    }
}

/* Landscape Mode (teléfonos en horizontal) */
@media (max-height: 600px) and (orientation: landscape) {
    .main-content {
        overflow-y: auto;
        align-items: flex-start;
        padding: 20px;
    }
    
    .login-container {
        padding: 20px 30px;
        margin: 20px auto;
        max-width: 80%;
    }
    
    .logo-container {
        margin-bottom: 10px;
    }
    
    .logo-shield {
        width: 60px;
    }
    
    .divider {
        margin: 10px auto;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .welcome-screen {
        display: none;
    }
    
    .main-content {
        animation: showMainContent 0.5s ease-out forwards;
    }
    
    .login-container {
        animation: fadeInContainer 0.5s ease-out forwards;
    }
}

/* Tablets en landscape */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .login-container {
        max-width: 70%;
    }
    
    .logo-shield {
        width: 100px;
    }
}

/* Soporte para pantallas con notch */
@supports (padding: max(0px)) {
    .main-content {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
        padding-top: max(20px, env(safe-area-inset-top));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
    
    .vista-btn {
        top: max(20px, env(safe-area-inset-top));
        right: max(20px, env(safe-area-inset-right));
    }
    
    .message-container {
        top: max(20px, env(safe-area-inset-top));
        right: max(20px, env(safe-area-inset-right));
    }
}

/* Reducción de movimiento */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .welcome-screen {
        animation: none;
        display: none;
    }
    
    .main-content {
        animation: none;
        opacity: 1;
    }
    
    .login-container {
        animation: none;
        opacity: 1;
    }
}