/* ============================================
   iShout Landing Page
   Holographic Glass Card + Parallax + Particles
   ============================================ */

/* ---- CSS Custom Property for border rotation ---- */
@property --border-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

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

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #05070A;
    color: #fff;
    height: 100%;
    overflow: hidden;
}

/* ---- Parallax Background Orbs ---- */
.parallax-bg {
    position: fixed;
    inset: -100px;
    z-index: 0;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.25;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #4F46E5 0%, transparent 70%);
    top: -15%;
    left: -10%;
    animation: orbDrift1 22s ease-in-out infinite;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #7C3AED 0%, transparent 70%);
    bottom: -15%;
    right: -10%;
    animation: orbDrift2 28s ease-in-out infinite;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #0EA5E9 0%, transparent 70%);
    top: 40%;
    left: 55%;
    animation: orbDrift3 18s ease-in-out infinite;
}

@keyframes orbDrift1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%      { transform: translate(60px, 40px) scale(1.05); }
    50%      { transform: translate(-30px, 80px) scale(0.95); }
    75%      { transform: translate(40px, -30px) scale(1.02); }
}

@keyframes orbDrift2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%      { transform: translate(-50px, -40px) scale(1.03); }
    50%      { transform: translate(40px, -60px) scale(0.97); }
    75%      { transform: translate(-30px, 50px) scale(1.05); }
}

@keyframes orbDrift3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(40px, -50px) scale(1.08); }
    66%      { transform: translate(-50px, 30px) scale(0.92); }
}

/* ---- Particles container (tsParticles) ---- */
#particles {
    position: fixed;
    inset: 0;
    z-index: 1;
}

#particles canvas {
    pointer-events: none;
}

/* ---- Vignette ---- */
.vignette {
    position: fixed;
    inset: 0;
    z-index: 2;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(5, 7, 10, 0.7) 100%);
    pointer-events: none;
}

/* ---- Login Wrapper ---- */
.login-wrapper {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100vh;
    padding: 20px;
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- Ambient glow behind card ---- */
.card-glow {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(79, 70, 229, 0.15) 0%,
        rgba(124, 58, 237, 0.1) 30%,
        rgba(14, 165, 233, 0.05) 60%,
        transparent 80%
    );
    filter: blur(40px);
    animation: glowPulse 5s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes glowPulse {
    from { opacity: 0.6; transform: scale(1); }
    to   { opacity: 1; transform: scale(1.15); }
}

/* ============================================
   THE CARD — Holographic Glass
   ============================================ */
.login-card {
    position: relative;
    width: 100%;
    max-width: 460px;
    border-radius: 28px;
    overflow: hidden;
}

/* ---- Rotating Holographic Border ---- */
.holo-border {
    position: absolute;
    inset: 0;
    border-radius: 28px;
    padding: 2px;
    background: conic-gradient(
        from var(--border-angle, 0deg),
        #8B5CF6,
        #EC4899,
        #F59E0B,
        #06B6D4,
        #3B82F6,
        #8B5CF6
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: rotateBorder 4s linear infinite;
    opacity: 0.7;
}

@keyframes rotateBorder {
    to { --border-angle: 360deg; }
}

/* Fallback for browsers without @property support */
@supports not (background: conic-gradient(from 0deg, red, blue)) {
    .holo-border {
        background: linear-gradient(135deg, #8B5CF6, #EC4899, #06B6D4, #F59E0B);
        animation: borderFallback 3s ease-in-out infinite alternate;
    }
    @keyframes borderFallback {
        from { opacity: 0.4; }
        to   { opacity: 0.9; }
    }
}

/* ---- Light Sweep Reflection ---- */
.light-sweep {
    position: absolute;
    inset: 0;
    border-radius: 28px;
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
}

.light-sweep::after {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: linear-gradient(
        115deg,
        transparent 42%,
        rgba(255, 255, 255, 0.03) 45%,
        rgba(255, 255, 255, 0.08) 48%,
        rgba(255, 255, 255, 0.12) 50%,
        rgba(255, 255, 255, 0.08) 52%,
        rgba(255, 255, 255, 0.03) 55%,
        transparent 58%
    );
    animation: sweepReflection 5s ease-in-out infinite;
}

@keyframes sweepReflection {
    0%   { transform: translateX(-30%) translateY(-30%) rotate(0deg); }
    100% { transform: translateX(50%) translateY(50%) rotate(0deg); }
}

/* ---- Card Inner (Glass Surface) ---- */
.card-inner {
    position: relative;
    z-index: 1;
    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.06) 0%,
        rgba(255, 255, 255, 0.02) 40%,
        rgba(139, 92, 246, 0.03) 70%,
        rgba(255, 255, 255, 0.04) 100%
    );
    backdrop-filter: blur(30px) saturate(1.2);
    -webkit-backdrop-filter: blur(30px) saturate(1.2);
    border-radius: 28px;
    padding: 52px 44px 40px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Subtle inner glass edge highlight */
.card-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 28px;
    border: 1px solid transparent;
    background: linear-gradient(
        160deg,
        rgba(255, 255, 255, 0.12) 0%,
        transparent 30%,
        transparent 70%,
        rgba(255, 255, 255, 0.04) 100%
    ) border-box;
    -webkit-mask:
        linear-gradient(#fff 0 0) padding-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* ---- Logo ---- */
.logo-area {
    text-align: center;
    margin-bottom: 36px;
}

.logo-img {
    max-width: 280px;
    width: 100%;
    height: auto;
    filter:
        drop-shadow(0 4px 20px rgba(139, 92, 246, 0.25))
        drop-shadow(0 0 40px rgba(245, 158, 11, 0.1));
    transition: filter 0.4s ease;
}

.logo-img:hover {
    filter:
        drop-shadow(0 4px 25px rgba(139, 92, 246, 0.4))
        drop-shadow(0 0 50px rgba(245, 158, 11, 0.2));
}

/* ---- Form ---- */
.input-group {
    margin-bottom: 22px;
}

.input-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-group input {
    width: 100%;
    padding: 15px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    color: #fff;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: all 0.35s ease;
    outline: none;
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.18);
}

.input-group input:focus {
    border-color: rgba(139, 92, 246, 0.5);
    background: rgba(139, 92, 246, 0.06);
    box-shadow:
        0 0 0 3px rgba(139, 92, 246, 0.1),
        0 0 25px -5px rgba(139, 92, 246, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ---- Sign In Button ---- */
.login-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #6D28D9, #7C3AED 40%, #8B5CF6);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.35s ease;
    position: relative;
    overflow: hidden;
    margin-top: 6px;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px -3px rgba(109, 40, 217, 0.4);
}

/* Shimmer sweep on button */
.login-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        120deg,
        transparent 30%,
        rgba(255, 255, 255, 0.15) 50%,
        transparent 70%
    );
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 30px -5px rgba(109, 40, 217, 0.5),
        0 0 20px -5px rgba(139, 92, 246, 0.3);
    background: linear-gradient(135deg, #7C3AED, #8B5CF6 40%, #A78BFA);
}

.login-btn:hover::after {
    transform: translateX(100%);
}

.login-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px -3px rgba(109, 40, 217, 0.4);
}

/* Loading state */
.login-btn.loading .btn-text { opacity: 0; }
.login-btn.loading .btn-loader { opacity: 1; }
.btn-text { transition: opacity 0.2s; }

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ---- Error Message ---- */
.error-message {
    color: #F87171;
    font-size: 14px;
    text-align: center;
    margin-bottom: 16px;
    padding: 0 8px;
    line-height: 1.4;
    min-height: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.error-message.visible {
    min-height: 20px;
    max-height: 80px;
    margin-bottom: 16px;
}

/* ---- Card Footer ---- */
.card-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.card-footer p {
    color: rgba(255, 255, 255, 0.2);
    font-size: 13px;
    font-weight: 300;
    letter-spacing: 0.3px;
}

/* ---- Footer ---- */
footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    text-align: center;
    padding: 16px;
    z-index: 10;
}

footer p {
    color: rgba(255, 255, 255, 0.2);
    font-size: 12px;
    font-weight: 300;
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
    .gradient-orb { animation: none !important; }
    .login-wrapper { animation: none !important; }
    .holo-border { animation: none !important; opacity: 0.5; }
    .light-sweep::after { animation: none !important; }
    .card-glow { animation: none !important; }
    .login-btn::after { transition: none; }
    .parallax-bg { transition: none; transform: none !important; }
}

/* ---- Backdrop-filter fallback ---- */
@supports not (backdrop-filter: blur(30px)) {
    .card-inner {
        background: linear-gradient(
            145deg,
            rgba(15, 18, 30, 0.94) 0%,
            rgba(20, 15, 35, 0.92) 100%
        );
    }
}

/* ---- Responsive ---- */
@media (max-width: 520px) {
    .login-card {
        max-width: 100%;
        border-radius: 22px;
    }

    .holo-border,
    .card-inner,
    .card-inner::before {
        border-radius: 22px;
    }

    .light-sweep {
        border-radius: 22px;
    }

    .card-inner {
        padding: 36px 24px 28px;
    }

    .logo-img {
        max-width: 220px;
    }

    .input-group input {
        padding: 13px 15px;
        font-size: 16px; /* Prevents iOS zoom */
    }

    .login-btn {
        padding: 14px;
    }
}

@media (max-height: 640px) {
    .logo-area {
        margin-bottom: 20px;
    }

    .logo-img {
        max-width: 200px;
    }

    .card-inner {
        padding: 28px 28px 24px;
    }

    .input-group {
        margin-bottom: 14px;
    }

    .card-footer {
        display: none;
    }
}
