/* =========================================================
   MATAKIN - Scenic Nature & Glassmorphism Animation System
   Features: 3D Flying Butterflies, Realistic Birds, 
             Floating Petals, Ambient Light & Frosted Glass Form
   ========================================================= */

:root {
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-bg-hover: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 20px 50px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.45) inset;
    --glass-blur: blur(20px) saturate(180%);
    --primary-gradient: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
    --gold-accent: #d97706;
}

/* ─── Page Container & Background ────────────────────── */
.auth-page-wrapper {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0f172a;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    box-sizing: border-box;
}

/* Desktop Split Layout: Form on the Right, Statue in Full View */
@media (min-width: 992px) {
    .auth-page-wrapper {
        justify-content: space-between;
        padding-left: 6vw;
        padding-right: 7vw;
    }
}

/* Scenic Temple Background Layer with Gentle Ambient Motion */
.auth-bg-layer {
    position: fixed;
    top: -3%;
    left: -3%;
    width: 106%;
    height: 106%;
    background-image: url('/img/temple_bg.jpg');
    background-size: cover;
    background-position: center 30%;
    background-repeat: no-repeat;
    z-index: 1;
    animation: bg-breathe 28s ease-in-out infinite alternate;
    transform-origin: center center;
    filter: brightness(0.96) contrast(1.02);
}

@media (min-width: 992px) {
    .auth-bg-layer {
        background-position: 28% 30%;
        /* Focus statue prominently in the open left-center */
    }
}

@keyframes bg-breathe {
    0% {
        transform: scale(1) translate(0, 0);
    }

    50% {
        transform: scale(1.04) translate(-1%, -0.5%);
    }

    100% {
        transform: scale(1.02) translate(1%, 0.5%);
    }
}

/* Atmospheric Sun Rays & Soft Vignette */
.auth-overlay-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    background: radial-gradient(circle at 80% 15%, rgba(255, 245, 205, 0.28) 0%, transparent 60%),
        radial-gradient(circle at 50% 50%, transparent 40%, rgba(15, 23, 42, 0.35) 100%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(0, 0, 0, 0.15) 100%);
}

/* ─── Left Side Scenic Hero Greeting (Desktop) ────────── */
.auth-scenic-intro {
    position: relative;
    z-index: 10;
    max-width: 460px;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    transition: opacity 0.5s ease, transform 0.5s ease;
    animation: fadeInIntro 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInIntro {
    0% {
        opacity: 0;
        transform: translateX(-30px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.scenic-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50px;
    font-size: 0.825rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.scenic-quote {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.05em;
    color: #ffffff;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 255, 255, 0.2);
}

.scenic-subquote {
    font-size: 1.05rem;
    font-weight: 500;
    color: #f1f5f9;
    line-height: 1.5;
    margin-bottom: 0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

/* ─── Top Action Buttons (Music & Zen Mode) ───────────── */
.auth-top-actions {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.auth-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.52rem 1.05rem;
    border-radius: 50px;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    user-select: none;
    line-height: 1;
}

.auth-action-btn:hover {
    background: rgba(37, 99, 235, 0.85);
    border-color: rgba(255, 255, 255, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.45);
    color: #ffffff;
}

.auth-action-btn:active {
    transform: translateY(0);
}

/* Sound Wave Equalizer Animation */
.sound-wave-bars {
    display: inline-flex;
    align-items: flex-end;
    gap: 2.5px;
    height: 13px;
    width: 13px;
}

.sound-wave-bars span {
    display: block;
    width: 2.5px;
    background: #38bdf8;
    border-radius: 2px;
    animation: soundWave 0.9s ease-in-out infinite alternate;
}

.sound-wave-bars span:nth-child(1) {
    height: 55%;
    animation-delay: 0.15s;
}

.sound-wave-bars span:nth-child(2) {
    height: 100%;
    animation-delay: 0.35s;
}

.sound-wave-bars span:nth-child(3) {
    height: 45%;
    animation-delay: 0.2s;
}

@keyframes soundWave {
    0% {
        height: 25%;
    }

    100% {
        height: 100%;
    }
}

/* Muted State for Music Button */
.music-toggle-btn.is-muted {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
    color: #94a3b8;
}

.music-toggle-btn.is-muted .sound-wave-bars span {
    animation: none !important;
    height: 2.5px !important;
    background: #64748b !important;
}

/* Zen Mode Button Specifics */
.zen-mode-active .auth-content-container,
.zen-mode-active .auth-scenic-intro {
    opacity: 0 !important;
    transform: translateY(40px) scale(0.94) !important;
    pointer-events: none !important;
}

.zen-mode-active .zen-mode-btn {
    background: #2563eb;
    border-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.4), 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* ─── Canvas Particle Overlay ─────────────────────────── */
.nature-canvas-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

/* ─── 3D Butterfly Container & CSS Wings ──────────────── */
.butterflies-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    pointer-events: none;
    overflow: hidden;
}

.butterfly-3d {
    position: absolute;
    width: 44px;
    height: 38px;
    transform-style: preserve-3d;
    perspective: 600px;
    pointer-events: auto;
    cursor: pointer;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.22));
    transition: filter 0.3s ease;
    will-change: transform, left, top;
}

.butterfly-3d:hover {
    filter: drop-shadow(0 10px 18px rgba(37, 99, 235, 0.5)) brightness(1.2);
}

.butterfly-body {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3px;
    height: 22px;
    margin-left: -1.5px;
    margin-top: -11px;
    background: #1e1e24;
    border-radius: 4px;
    z-index: 2;
}

.butterfly-wing {
    position: absolute;
    top: 0;
    width: 22px;
    height: 34px;
    border-radius: 50% 50% 20% 60%;
    transform-origin: right center;
    box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.4);
    opacity: 0.94;
}

.butterfly-wing.wing-left {
    left: 0;
    transform-origin: right center;
    animation: flap-left 0.28s ease-in-out infinite alternate;
}

.butterfly-wing.wing-right {
    left: 22px;
    transform-origin: left center;
    border-radius: 50% 50% 60% 20%;
    animation: flap-right 0.28s ease-in-out infinite alternate;
}

@keyframes flap-left {
    0% {
        transform: rotateY(0deg) rotateZ(-6deg);
    }

    100% {
        transform: rotateY(74deg) rotateZ(-12deg);
    }
}

@keyframes flap-right {
    0% {
        transform: rotateY(0deg) rotateZ(6deg);
    }

    100% {
        transform: rotateY(-74deg) rotateZ(12deg);
    }
}

/* Butterfly Color Variants */
.butterfly-blue .butterfly-wing {
    background: radial-gradient(circle at 70% 30%, #67e8f9 0%, #0284c7 45%, #1e1b4b 100%);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.butterfly-gold .butterfly-wing {
    background: radial-gradient(circle at 70% 30%, #fef08a 0%, #f59e0b 50%, #78350f 100%);
    border: 1px solid rgba(254, 240, 138, 0.5);
}

.butterfly-emerald .butterfly-wing {
    background: radial-gradient(circle at 70% 30%, #a7f3d0 0%, #10b981 50%, #064e3b 100%);
    border: 1px solid rgba(167, 243, 208, 0.5);
}

.butterfly-violet .butterfly-wing {
    background: radial-gradient(circle at 70% 30%, #fbcfe8 0%, #d946ef 50%, #4c1d95 100%);
    border: 1px solid rgba(251, 207, 232, 0.5);
}

.butterfly-sunset .butterfly-wing {
    background: radial-gradient(circle at 70% 30%, #fed7aa 0%, #f43f5e 55%, #881337 100%);
    border: 1px solid rgba(254, 215, 170, 0.5);
}

/* ─── Special Interactive Red Butterfly (Ruby) ────────── */
.butterfly-ruby {
    z-index: 20 !important;
    filter: drop-shadow(0 0 12px rgba(225, 29, 72, 0.8)) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.35)) !important;
    animation: ruby-glow 2.5s ease-in-out infinite alternate;
}

@keyframes ruby-glow {
    0% {
        filter: drop-shadow(0 0 8px rgba(225, 29, 72, 0.6)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    }

    100% {
        filter: drop-shadow(0 0 18px rgba(255, 75, 110, 0.95)) drop-shadow(0 8px 16px rgba(225, 29, 72, 0.5));
    }
}

.butterfly-ruby .butterfly-wing {
    background: radial-gradient(circle at 70% 30%, #ff6b81 0%, #e11d48 55%, #881337 100%) !important;
    border: 1.5px solid rgba(255, 225, 100, 0.8) !important;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.6) !important;
}

.butterfly-ruby:hover {
    filter: drop-shadow(0 0 24px #ff1744) brightness(1.3) !important;
}

/* Frozen State: When hovering/clicking the red butterfly */
.butterflies-frozen .butterfly-wing {
    animation-play-state: paused !important;
}

/* ─── Template Version Bubble Info ────────────────────── */
.butterfly-version-bubble {
    position: fixed;
    z-index: 100;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1.5px solid rgba(244, 63, 94, 0.7);
    border-radius: 16px;
    padding: 0.85rem 1.15rem;
    color: #ffffff;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), 0 0 25px rgba(225, 29, 72, 0.35);
    pointer-events: auto;
    animation: bubblePop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transform-origin: bottom center;
    min-width: 180px;
    text-align: center;
    user-select: none;
}

@keyframes bubblePop {
    0% {
        opacity: 0;
        transform: translate(-50%, -100%) translateY(10px) scale(0.85);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -100%) translateY(-15px) scale(1);
    }
}

.bubble-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.6rem;
    background: rgba(225, 29, 72, 0.25);
    border: 1px solid rgba(244, 63, 94, 0.5);
    color: #fda4af;
    border-radius: 20px;
    margin-bottom: 0.35rem;
}

.bubble-date-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #facc15;
    letter-spacing: 0.04em;
    margin-bottom: 0;
    line-height: 1.4;
}

.bubble-close-btn {
    position: absolute;
    top: 6px;
    right: 8px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1rem;
    cursor: pointer;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 50%;
    transition: color 0.2s ease;
}

.bubble-close-btn:hover {
    color: #ffffff;
}


/* ─── Birds Flying Animation (CSS & SVG) ──────────────── */
.birds-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
    overflow: hidden;
}

.bird {
    position: absolute;
    width: 32px;
    height: 24px;
    will-change: transform;
}

.bird-svg {
    width: 100%;
    height: 100%;
    fill: #27272a;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.bird .wing-flap {
    transform-origin: 50% 50%;
    animation: bird-wing 0.35s ease-in-out infinite alternate;
}

@keyframes bird-wing {
    0% {
        transform: scaleY(1) translateY(0);
    }

    100% {
        transform: scaleY(-0.8) translateY(-4px);
    }
}

/* ─── Glassmorphism Login Card ────────────────────────── */
.auth-content-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
    padding: 1.25rem;
    animation: card-appear 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes card-appear {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }

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

.auth-glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1.5px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    padding: 2.25rem 2rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease;
}

.auth-glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    background: linear-gradient(60deg,
            transparent 30%,
            rgba(255, 255, 255, 0.3) 50%,
            transparent 70%);
    transform: rotate(25deg);
    pointer-events: none;
    opacity: 0.6;
    animation: glass-shimmer 12s infinite linear;
}

@keyframes glass-shimmer {
    0% {
        transform: translateX(-100%) rotate(25deg);
    }

    100% {
        transform: translateX(100%) rotate(25deg);
    }
}

.auth-glass-card:hover {
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}

/* Floating Logo Style */
.auth-logo-badge {
    position: relative;
    display: inline-block;
    padding: 10px;
    margin-bottom: 0.75rem;
    animation: gentle-float 4s ease-in-out infinite;
}

@keyframes gentle-float {

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

    50% {
        transform: translateY(-6px);
    }
}

.auth-logo-badge img {
    width: 78px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

/* Card Typography */
.auth-title {
    font-size: 1.55rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

.auth-subtitle {
    font-size: 0.875rem;
    color: #475569;
    font-weight: 500;
}

/* Glass Inputs */
.glass-input-group {
    background: rgba(255, 255, 255, 0.85);
    border: 1.5px solid rgba(203, 213, 225, 0.8);
    border-radius: 14px;
    transition: all 0.25s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.glass-input-group:focus-within {
    border-color: #2563eb;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18), 0 4px 12px rgba(37, 99, 235, 0.08);
    transform: translateY(-1px);
}

.glass-input-group .input-group-text {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 1.15rem;
    padding-left: 1rem;
    padding-right: 0.5rem;
}

.glass-input-group .form-control {
    background: transparent;
    border: none;
    color: #0f172a;
    font-size: 0.93rem;
    font-weight: 500;
    padding: 0.75rem 0.75rem 0.75rem 0;
}

.glass-input-group .form-control:focus {
    box-shadow: none;
}

.glass-input-group .form-control::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.password-toggle-btn {
    border: none;
    background: transparent;
    color: #64748b;
    padding: 0 0.9rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.password-toggle-btn:hover {
    color: #2563eb;
}

/* Glass Buttons */
.btn-glass-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    border-radius: 14px;
    padding: 0.8rem 1.5rem;
    font-size: 0.975rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-glass-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transition: left 0.6s ease;
}

.btn-glass-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.45);
    color: #ffffff;
}

.btn-glass-primary:hover::after {
    left: 100%;
}

.btn-glass-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Interactive Badge / Pill */
.auth-pill-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.auth-pill-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Alerts inside Glass */
.glass-alert {
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: rgba(254, 242, 242, 0.85);
    backdrop-filter: blur(8px);
    font-size: 0.875rem;
}

.glass-alert-success {
    border: 1px solid rgba(16, 185, 129, 0.3);
    background: rgba(236, 253, 245, 0.85);
}

/* Decorative Nature Pill info bottom */
.nature-footer-note {
    text-align: center;
    margin-top: 1rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.775rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    font-weight: 500;
}

.nature-footer-note span {
    display: inline-block;
    padding: 0.2rem 0.75rem;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 20px;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ─── Mobile Responsiveness ──────────────────────────── */
@media (max-width: 991.98px) {
    .auth-page-wrapper {
        padding: 1.5rem 1rem;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .auth-content-container {
        padding: 0.85rem;
    }

    .auth-glass-card {
        padding: 1.75rem 1.25rem;
        border-radius: 20px;
    }

    .auth-logo-badge img {
        width: 68px;
    }

    .auth-title {
        font-size: 1.35rem;
    }

    .zen-mode-btn {
        top: 1rem;
        right: 1rem;
        padding: 0.4rem 0.85rem;
        font-size: 0.78rem;
    }

    .zen-mode-btn span {
        display: none;
        /* Icon-only on very small devices */
    }
}