/* --- GLOBAL RESET & STRICT NO-SCROLL --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* THIN DARK GREEN SCROLLBAR (It's back!) */
::-webkit-scrollbar {
    width: 6px; /* Super thin and sleek */
}
::-webkit-scrollbar-track {
    background: #050505; /* Blends seamlessly with your dark background */
}
::-webkit-scrollbar-thumb {
    background: #0F6E56; /* Vaults Wallet Dark Green */
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #1D9E75; /* Slightly brighter green when hovering */
}

/* KILLS ONLY SIDE-SCROLLING, ALLOWS VERTICAL SCROLLING */
html, body {
    overflow-x: hidden; 
    width: 100vw;
}

:root {
    --bg-dark: #050505;
    --glass-bg: rgba(20, 20, 20, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #FFFFFF;
    --text-muted: #888888;
    --accent: #D4FF00; /* Lemonish Volt */
    --accent-glow: rgba(212, 255, 0, 0.25);
    --primary-glow: rgba(138, 43, 226, 0.2);
    --radius-lg: 24px;
    --radius-md: 12px;
    --font-family: 'Inter', sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh; /* Allows the page to grow beyond screen height */
    display: flex; 
    justify-content: center; 
    align-items: flex-start; /* Stops the top from being cut off on mobile */
    padding: 40px 16px; /* Adds breathing room on mobile */
    position: relative;
    overflow-y: auto; /* Brings back the vertical scrollbar only when needed */
}

/* --- AMBIENT GLOW ANIMATION --- */
.ambient-light {
    position: absolute; border-radius: 50%; filter: blur(100px);
    z-index: 0; animation: floatOrb 10s infinite alternate ease-in-out;
    pointer-events: none; 
    max-width: 100vw; 
}
.light-volt { width: 400px; height: 400px; background: var(--accent-glow); top: -10%; left: -5%; }
.light-purple { width: 500px; height: 500px; background: var(--primary-glow); bottom: -10%; right: -5%; animation-delay: -5s; }

@keyframes floatOrb {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 50px) scale(1.1); }
}

/* --- GLASS CARD --- */
.centered-wrapper { 
    position: relative; 
    z-index: 10; 
    width: 100%; 
    max-width: 760px; 
    margin: auto; /* CSS Magic: Centers the form vertically on desktop, allows scrolling on mobile */
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
    /* Reduced extreme vertical padding (was 72px) so the whole form fits on screen */
    padding: 40px 40px; 
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    width: 100%;
}

@keyframes slideUpFade {
    0% { opacity: 0; transform: translateY(40px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* --- HEADER & GRADIENT TITLE --- */
/* Reduced margin-bottom (was 48px) to save vertical space */
.card-header { text-align: center; margin-bottom: 32px; } 
.logo-mark {
    width: 100% !important; height: 180px;
    /* border: 1px solid green; */
    margin-bottom: 12px;
}

h1 { 
    font-family: 'Space Grotesk', sans-serif; 
    font-size: 32px; 
    margin: 0 0 8px 0; 
    background: linear-gradient(135deg, var(--accent) 0%, #00FF87 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.subtitle { color: var(--text-muted); font-size: 14px; margin: 0; }

/* --- Z-INDEX STACKING FOR ANIMATIONS --- */
.stagger-form .anim-item { opacity: 0; transform: translateY(15px); animation: fadeUpItem 0.5s forwards cubic-bezier(0.16, 1, 0.3, 1); position: relative; }
.stagger-form .anim-item:nth-child(1) { animation-delay: 0.2s; z-index: 10; }
.stagger-form .anim-item:nth-child(2) { animation-delay: 0.3s; z-index: 9; }
.stagger-form .anim-item:nth-child(3) { animation-delay: 0.4s; z-index: 8; } 
.stagger-form .anim-item:nth-child(4) { animation-delay: 0.5s; z-index: 7; } 
.stagger-form .anim-item:nth-child(5) { animation-delay: 0.6s; z-index: 6; }

@keyframes fadeUpItem { to { opacity: 1; transform: translateY(0); } }

/* --- COMPACT 2-COLUMN GRID --- */
.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 20px; width: 100%; }

/* --- INPUT FIELDS --- */
.input-group { 
    position: relative; border: 1px solid var(--glass-border); border-radius: var(--radius-md); 
    background: rgba(0, 0, 0, 0.4); transition: all 0.3s ease; display: flex; align-items: center;
    width: 100%;
}
.input-group:focus-within, .custom-dropdown.open { border-color: var(--accent); box-shadow: 0 0 15px var(--accent-glow); background: rgba(0, 0, 0, 0.6); }

/* FIX: Deep padding so text stays below the label */
.input-group input { 
    width: 100%; background: transparent; border: none; padding: 24px 16px 8px 16px; 
    color: var(--text-main); font-size: 14px; outline: none; 
}
.input-group input::placeholder { color: transparent; }

.input-group label {
    position: absolute; left: 16px; top: 16px; color: var(--text-muted); font-size: 14px; 
    pointer-events: none; transition: all 0.2s ease;
}

.input-group input:focus + label, .input-group input:not(:placeholder-shown) + label, label.active-label {
    top: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--accent);
}

.input-icon { position: absolute; right: 16px; top: 16px; width: 18px; color: var(--text-muted); }

/* --- DROPDOWNS (Country & Phone) --- */
.custom-dropdown { cursor: pointer; }
/* FIX: Deep padding for dropdown triggers */
.dropdown-trigger { width: 100%; padding: 24px 16px 8px 16px; display: flex; justify-content: space-between; align-items: center; }
.selected-val { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; color: var(--text-main); }
.circle-flag { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; box-shadow: 0 2px 6px rgba(0,0,0,0.5); flex-shrink: 0; }
.chevron { width: 16px; transition: transform 0.2s; color: var(--text-muted); flex-shrink: 0; }
.custom-dropdown.open .chevron { transform: rotate(180deg); color: var(--accent); }

/* Phone Prefix Divider */
.phone-group { align-items: stretch; }
/* FIX: Deep padding for phone trigger */
.phone-prefix-trigger { 
    display: flex; align-items: center; gap: 6px; padding: 24px 12px 8px 16px; 
    border-right: 1px solid var(--glass-border); cursor: pointer; font-size: 14px; font-weight: 600;
    white-space: nowrap; flex-shrink: 0;
}
.chevron-small { width: 12px; color: var(--text-muted); }

/* Dropdown Menu */
.dropdown-menu {
    position: absolute; top: calc(100% + 4px); left: 0; width: 100%;
    background: #0A0A0A; border: 1px solid var(--glass-border); border-radius: var(--radius-md);
    z-index: 9999; display: none; flex-direction: column; box-shadow: 0 15px 35px rgba(0,0,0,0.9);
}
.custom-dropdown.open .dropdown-menu { display: flex; animation: popIn 0.2s ease; }
@keyframes popIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

.dropdown-search { padding: 10px; border-bottom: 1px solid var(--glass-border); display: flex; align-items: center; gap: 8px; background: #111111; border-radius: var(--radius-md) var(--radius-md) 0 0; }
.dropdown-search input { padding: 4px; color: var(--text-main); background: transparent; width: 100%; }
.dropdown-search input:focus { outline: none; }
.dropdown-search i { width: 16px; color: var(--text-muted); flex-shrink: 0; }

.dropdown-list { list-style: none; padding: 0; margin: 0; max-height: 200px; overflow-y: auto; }
.dropdown-list::-webkit-scrollbar { width: 4px; }
.dropdown-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; }
.dropdown-item { padding: 12px 16px; display: flex; align-items: center; gap: 12px; font-size: 13px; transition: background 0.2s; }
.dropdown-item:hover { background: #1A1A1A; }
.dropdown-item .code-text { margin-left: auto; color: var(--text-muted); }

/* --- BUTTON --- */
.submit-btn {
    width: 100%; padding: 16px; margin-top: 24px;
    /* Updated to match the Vaults Wallet title gradient */
    background: linear-gradient(135deg, var(--accent) 0%, #00FF87 100%); 
    color: #000;
    border: none; border-radius: var(--radius-md);
    font-size: 16px; font-weight: 700; cursor: pointer;
    display: flex; justify-content: center; align-items: center; gap: 8px;
    box-shadow: 0 10px 20px var(--accent-glow); transition: all 0.2s ease;
}

.submit-btn:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 15px 25px var(--accent-glow); 
    filter: brightness(1.1); 
}

.auth-link { text-align: center; margin-top: 24px; font-size: 14px; color: var(--text-muted); }
.auth-link a { color: var(--text-main); font-weight: 600; text-decoration: none; transition: text-shadow 0.2s; }
.auth-link a:hover { text-shadow: 0 0 10px var(--accent-glow); color: var(--accent); }

/* =========================================
   MODERN WEB3 TOAST NOTIFICATIONS
   ========================================= */
.toast-container {
    position: fixed;
    top: 32px;
    right: 32px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 16px;
    pointer-events: none;
}

.toast-notify {
    background: rgba(15, 15, 15, 0.7);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    padding: 16px 24px;
    border-radius: 100px; /* Modern Pill Shape */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 320px;
    animation: toastEnter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    pointer-events: auto;
    overflow: hidden;
    position: relative;
}

/* Subtle Ambient Glow inside the toast */
.toast-notify::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 100%;
    background: linear-gradient(90deg, rgba(255, 69, 58, 0.15) 0%, transparent 100%);
    z-index: -1;
}

.toast-notify.success::before {
    background: linear-gradient(90deg, rgba(212, 255, 0, 0.15) 0%, transparent 100%);
}

/* Custom Icon Wrappers */
.icon-wrapper {
    display: flex; justify-content: center; align-items: center;
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255, 69, 58, 0.15);
    color: #FF453A; flex-shrink: 0;
    box-shadow: 0 0 15px rgba(255, 69, 58, 0.2);
}

.toast-notify.success .icon-wrapper {
    background: rgba(212, 255, 0, 0.15);
    color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

.toast-notify i { width: 18px; height: 18px; }

/* Animated Progress Bar */
.toast-progress {
    position: absolute; bottom: 0; left: 0;
    height: 2px; background: #FF453A; width: 100%;
    animation: progressShrink 4s linear forwards;
}

.toast-notify.success .toast-progress {
    background: var(--accent);
}

/* Animations */
.toast-notify.hiding {
    animation: toastExit 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastEnter {
    from { transform: translateX(120%) scale(0.9); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes toastExit {
    from { transform: translateX(0) scale(1); opacity: 1; }
    to { transform: translateX(120%) scale(0.9); opacity: 0; }
}

@keyframes progressShrink {
    from { width: 100%; }
    to { width: 0%; }
}

/* Spinner Animation for the Processing Button */
@keyframes spin { 100% { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }

.input-group a:hover {
    opacity: 1 !important;
    text-shadow: 0 0 8px var(--accent-glow);
}

.center{
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Mobile Alignment for Toasts */
@media (max-width: 480px) {
    .toast-container { top: 16px; left: 16px; right: 16px; align-items: center; }
    .toast-notify { min-width: 100%; }
}

/* =========================================
   RESPONSIVE DESIGN (TABLET & MOBILE FIXES)
   ========================================= */

/* Tablets */
@media (max-width: 768px) {
    .glass-card { padding: 32px 24px; }
    .input-row { grid-template-columns: 1fr; gap: 16px; }
    .ambient-light { opacity: 0.6; }
}

/* Mobile Phones */
@media (max-width: 480px) {
    .centered-wrapper { padding: 12px; margin: 20px 0; }
    .glass-card { padding: 24px 16px; border-radius: 16px; }
    
    h1 { font-size: 26px; }
    .subtitle { font-size: 13px; }
    
    /* .logo-mark { width: 80%; height: auto; } */
    
    /* FIX: Ensure mobile padding remains deep so labels don't crash into text */
    .input-group input, 
    .dropdown-trigger, 
    .phone-prefix-trigger {
        padding-top: 24px;
        padding-bottom: 8px;
        font-size: 14px;
    }
    
    /* Ensure the label stays pinned to the top */
    .input-group label.active-label,
    .input-group input:focus + label, 
    .input-group input:not(:placeholder-shown) + label {
        top: 6px;
        font-size: 10px;
    }

    .phone-prefix-trigger { padding-left: 12px; padding-right: 10px; }
    .submit-btn { padding: 14px; font-size: 15px; }
}