/* ========================================
   GLOBAL STYLES & BACKGROUNDS
   ======================================== */
body {
    overflow-y: auto;
    position: relative;
    background-color: #070b13 !important;
    background-image: 
        radial-gradient(circle at 14% 18%, rgba(0, 245, 233, 0.12), transparent 16%),
        radial-gradient(circle at 82% 12%, rgba(0, 191, 255, 0.08), transparent 16%),
        linear-gradient(135deg, #05080e 0%, #070b13 50%, #030508 100%) !important;
    color: #f7fbff;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: linear-gradient(180deg, rgba(255, 255, 255, 0.4), transparent 78%);
    -webkit-mask-image: linear-gradient(180deg, rgba(255, 255, 255, 0.4), transparent 78%);
    pointer-events: none;
    z-index: 0;
}

/* ========================================
   AUTH SHELL - SPLIT LAYOUT
   ======================================== */
.auth-shell {
    position: relative;
    z-index: 1;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column-reverse;
    width: 100%;
    overflow-y: auto;
}

/* ========================================
   HERO PANEL (LEFT SIDE)
   ======================================== */
.auth-hero-panel {
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
    height: 45%;
    flex: none;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
}

@media (min-width: 1024px) and (orientation: landscape) {
    .auth-shell {
        flex-direction: row;
        overflow: hidden;
    }
    .auth-hero-panel {
        width: 50%;
        height: 100%;
        flex: 1;
        padding: 3rem;
    }
}

/* Hero Background Grid */
.auth-hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 100px 100px;
    z-index: 0;
    opacity: 0.5;
}

/* Hero Glow Effects */
.auth-hero-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
}

.auth-hero-glow-cyan {
    width: 400px;
    height: 400px;
    background: rgba(0, 245, 233, 0.15);
    top: -100px;
    right: 10%;
    animation: float-glow 6s ease-in-out infinite;
}

.auth-hero-glow-blue {
    width: 350px;
    height: 350px;
    background: rgba(0, 191, 255, 0.12);
    bottom: 10%;
    left: 5%;
    animation: float-glow 8s ease-in-out infinite 1s;
}

@keyframes float-glow {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, -30px); }
}

/* Hero Content */
.auth-hero-content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 520px;
    text-align: left;
}

.auth-hero-inner {
    animation: slideInUp 0.8s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-hero-logo {
    margin-bottom: 2rem;
}

.hero-logo-img {
    width: 180px;
    filter: drop-shadow(0 0 20px rgba(0, 245, 233, 0.3));
}

.auth-hero-title {
    font-size: 2.5rem;
    line-height: 1.2;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #f7fbff;
}

.gradient-text {
    background: linear-gradient(135deg, #00f5e9 0%, #00bfff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-hero-description {
    font-size: 1.1rem;
    color: #a0b3c5;
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

/* Feature List */
.auth-feature-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.auth-feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: fadeInLeft 0.6s ease-out backwards;
}

.auth-feature-item:nth-child(1) {
    animation-delay: 0.2s;
}

.auth-feature-item:nth-child(2) {
    animation-delay: 0.4s;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.auth-feature-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00f5e9;
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(0, 245, 233, 0.6);
}

.auth-feature-item span {
    color: #a0b3c5;
    font-size: 1rem;
}

/* ========================================
   FORM PANEL (RIGHT SIDE)
   ======================================== */
.auth-form-side {
    width: 100%;
    height: 55%;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    min-width: 0;
}

@media (min-width: 1024px) and (orientation: landscape) {
    .auth-form-side {
        width: 50%;
        height: 100%;
        flex: 1;
        padding: 2rem;
    }
}

.auth-form-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* ========================================
   FORM CARD - GLASSMORPHIC
   ======================================== */
.auth-form-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: rgba(11, 18, 32, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    padding: 2.5rem;
    border-radius: 1.75rem;
    box-shadow: 0 28px 72px rgba(0, 0, 0, 0.4), 0 0 30px rgba(0, 245, 233, 0.05);
    width: 100%;
    max-width: 440px;
    position: relative;
    transition: all 0.3s ease;
}

.auth-form-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(0, 245, 233, 0.35), transparent 42%, rgba(0, 191, 255, 0.12));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.auth-form-card:hover {
    border-color: rgba(0, 245, 233, 0.2);
    box-shadow: 0 28px 72px rgba(0, 0, 0, 0.45), 0 0 40px rgba(0, 245, 233, 0.15);
}

/* Mobile Logo */
.auth-form-mobile-logo {
    display: none;
}

.mobile-logo-img {
    width: 140px;
    margin: 0 auto 1rem auto;
    filter: drop-shadow(0 0 12px rgba(0, 245, 233, 0.25));
}

/* Form Messages */
.auth-form-messages {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.warning {
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 0.75rem;
    color: #fca5a5;
    font-size: 0.9rem;
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Header */
.auth-form-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.auth-form-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #f7fbff;
    margin: 0;
}

.auth-form-subtitle {
    color: #a0b3c5;
    font-size: 0.95rem;
    margin: 0;
}

/* ========================================
   FORM STYLING
   ======================================== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    transition: opacity 0.15s ease;
}

.auth-form.form-exit {
    opacity: 0.5;
}

.auth-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.auth-form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #8a99ad;
    margin: 0;
}

/* Input Wrapper */
.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 1rem;
    width: 20px;
    height: 20px;
    color: #8a99ad;
    pointer-events: none;
    flex-shrink: 0;
}

.auth-form-group input[type="text"],
.auth-form-group input[type="email"],
.auth-form-group input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    font-size: 0.95rem;
    color: #f7fbff;
    background: rgba(7, 11, 19, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.auth-form-group input[type="text"]:focus,
.auth-form-group input[type="email"]:focus,
.auth-form-group input[type="password"]:focus {
    border-color: #00f5e9;
    box-shadow: 0 0 0 3px rgba(0, 245, 233, 0.15);
    background: rgba(7, 11, 19, 0.9) !important;
}

.auth-form-group input::placeholder {
    color: #5a6b7d;
}

/* Password Toggle Button */
.auth-password-toggle {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: #8a99ad;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    transition: color 0.2s ease;
}

.auth-password-toggle:hover {
    color: #00f5e9;
}

.auth-password-toggle svg {
    width: 20px;
    height: 20px;
}

/* ========================================
   FORGOT PASSWORD LINK
   ======================================== */
.auth-forgot-password {
    display: flex;
    justify-content: flex-end;
    min-height: 24px;
}

/* ========================================
   SUBMIT BUTTON
   ======================================== */
.btn-login {
    width: 100%;
    font-family: 'Outfit', 'Segoe UI', sans-serif;
    font-weight: 600;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    color: #070b13 !important;
    background: linear-gradient(135deg, #00f5e9 0%, #00bfff 100%) !important;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 245, 233, 0.15);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-transform: none;
}

.btn-login:hover:not(:disabled) {
    background: linear-gradient(135deg, #00e0d5 0%, #00a6e0 100%) !important;
    box-shadow: 0 12px 28px rgba(0, 245, 233, 0.3), 0 0 20px rgba(0, 245, 233, 0.2);
    transform: translateY(-2px);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ========================================
   FORM MODE TOGGLE
   ======================================== */
.auth-mode-toggle {
    display: flex;
    justify-content: center;
    padding-top: 0.5rem;
}

.auth-toggle-text {
    font-size: 0.95rem;
    color: #a0b3c5;
    margin: 0;
}

.auth-link-button {
    background: none;
    border: none;
    color: #00f5e9;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
    font-size: inherit;
    font-family: inherit;
    transition: all 0.2s ease;
    padding: 0;
    margin-left: 0.25rem;
}

.auth-link-button:hover {
    color: #00e0d5;
    text-decoration: underline;
    text-shadow: 0 0 8px rgba(0, 245, 233, 0.4);
}

/* ========================================
   RESPONSIVE DESIGN / PORTRAIT OPTIMIZATIONS
   ======================================== */
@media (orientation: portrait) {
    .auth-shell {
        flex-direction: column-reverse;
        overflow: hidden; /* Lock viewport on tall portrait displays (like 1080x1920) */
    }

    .auth-hero-inner {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .auth-hero-content {
        text-align: center;
        max-width: 480px;
    }

    .auth-hero-logo {
        margin-bottom: 1rem;
    }

    .hero-logo-img {
        width: 130px;
    }

    .auth-hero-title {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }

    .auth-hero-description {
        font-size: 0.95rem;
        margin-bottom: 1.25rem;
        line-height: 1.5;
    }

    .auth-feature-list {
        flex-direction: row;
        justify-content: center;
        gap: 1.5rem;
    }

    .auth-feature-item {
        gap: 0.5rem;
    }

    .auth-form-side {
        min-height: 0 !important;
    }
}

@media (max-width: 768px) {
    .auth-form-card {
        padding: 1.75rem;
        gap: 1rem;
    }

    .auth-form-header h2 {
        font-size: 1.5rem;
    }
}

/* Scroll fallback only on short height screens in portrait */
@media (orientation: portrait) and (max-height: 800px) {
    .auth-shell {
        overflow-y: auto;
    }
    
    .auth-hero-panel, .auth-form-side {
        height: auto;
        flex: 1 0 auto;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.auth-form-card {
    animation: fadeIn 0.5s ease-out;
}

/* ========================================
   LEGACY/FALLBACK STYLES
   ======================================== */
.outer-container {
    position: relative;
    z-index: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.outer-container main {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.content-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

.contenedor_flexbox {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: rgba(11, 18, 32, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    padding: 2.5rem;
    border-radius: 1.75rem;
    box-shadow: 0 28px 72px rgba(0, 0, 0, 0.4), 0 0 30px rgba(0, 245, 233, 0.05);
    width: 100%;
    max-width: 440px;
    position: relative;
    transition: all 0.3s ease;
}

.contenedor_flexbox::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(0, 245, 233, 0.35), transparent 42%, rgba(0, 191, 255, 0.12));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.contenedor_flexbox:hover {
    border-color: rgba(0, 245, 233, 0.2);
    box-shadow: 0 28px 72px rgba(0, 0, 0, 0.45), 0 0 40px rgba(0, 245, 233, 0.15);
}

#formContent {
    margin-top: 0.5rem;
}

.form_items {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.form_items div {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form_items label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #8a99ad;
}

.form_items input[type="text"],
.form_items input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    color: #f7fbff;
    background: rgba(7, 11, 19, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    outline: none;
    transition: all 0.2s ease;
}

.form_items input[type="text"]:focus,
.form_items input[type="password"]:focus {
    border-color: #00f5e9;
    box-shadow: 0 0 0 3px rgba(0, 245, 233, 0.15);
}

input[type="submit"] {
    width: 100%;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    color: #070b13 !important;
    background: linear-gradient(135deg, #00f5e9 0%, #00bfff 100%) !important;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 245, 233, 0.15);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

input[type="submit"]:hover {
    background: linear-gradient(135deg, #00e0d5 0%, #00a6e0 100%) !important;
    box-shadow: 0 12px 28px rgba(0, 245, 233, 0.3), 0 0 20px rgba(0, 245, 233, 0.2);
    transform: translateY(-2px);
}

.tiny {
    font-size: 0.8rem;
    margin: 0.5rem auto 0 auto;
    color: #8a99ad;
}

.tiny a {
    color: #00f5e9;
    font-weight: 500;
}

.tiny a:hover {
    text-decoration: underline;
    text-shadow: 0 0 8px rgba(0, 245, 233, 0.4);
}

.login-background-container {
    display: none;
}

.admin-card {
    background: rgba(11, 18, 32, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    padding: 40px;
    border-radius: 1.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    margin: 0 auto;
}

.login-logo {
    width: 160px;
    margin: 0 auto 1.5rem auto;
    display: block;
    filter: drop-shadow(0 0 12px rgba(0, 245, 233, 0.25));
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

footer {
    padding: 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: rgba(138, 153, 173, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    background: transparent;
}
