/* --- Global Reset & Variables --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #0a0a0f;
    --bg-card: #14151b;
    --text-main: #ffffff;
    --text-muted: #9aa0a6;
    --accent-blue: #5b67f1;
    --accent-pink: #d348a3;
    --border-color: #262730;
    --font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-family);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    overflow-x: hidden;
}

/* --- Layout --- */
.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    flex: 1;
}

/* --- Header --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.logo {
    display: flex;
    align-items: center;
    font-size: 20px;
    font-weight: 700;
    gap: 10px;
}

.logo-icon {
    font-size: 24px;
    filter: drop-shadow(0 0 5px rgba(100, 255, 100, 0.5));
}

/* --- Buttons --- */
.btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 20px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-primary:hover {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.6);
    transform: translateY(-2px);
}

/* --- Hero Section --- */
.hero {
    text-align: center;
    padding: 80px 20px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-icon-wrapper {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99,102,241,0.2) 0%, transparent 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    border: 1px solid rgba(99,102,241,0.3);
}

.hero-icon {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 50%;
    display: block;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.hero h1 .highlight {
    color: var(--accent-blue);
    font-weight: 500;
}

/* Blinking cursor for the typing animation */
.hero h1 .cursor {
    display: inline-block;
    color: var(--accent-blue);
    font-weight: 500;
    margin-left: 2px;
    animation: blink 1s steps(1) infinite;
}

@keyframes blink {
    0%, 49%   { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.hero-desc {
    max-width: 650px;
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.hero-btn {
    padding: 14px 40px;
    font-size: 16px;
    border-radius: 30px;
}

/* --- Deep Sync Section --- */
.sync-section {
    padding: 60px 0;
    text-align: center;
}

.sync-section h2 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.sync-subtitle {
    color: var(--text-muted);
    margin-bottom: 50px;
    font-size: 1.1rem;
}

.highlight-pink {
    color: var(--accent-pink);
    font-weight: 600;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 15px;
    text-align: left;
}

.grid-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.grid-card:hover {
    background-color: #1a1b22;
    border-color: #3b3d4a;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.card-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.blue-icon { background: #1e3a8a; color: #60a5fa; }
.dark-icon { background: #1f2937; color: #9ca3af; }
.red-icon { background: #7f1d1d; color: #f87171; }
.yellow-icon { background: #713f12; color: #facc15; }
.orange-icon { background: #7c2d12; color: #fb923c; }

.card-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #fff;
}

.card-content p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* --- Connect Page Styles --- */
.secure-connection {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #a7f3d0;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
}

.connect-section {
    text-align: center;
    padding: 60px 0 80px;
}

.connect-section h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.underline {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #d348a3);
    margin: 0 auto 25px;
    border-radius: 2px;
}

.connect-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 50px;
}

.wallet-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}

.wallet-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 25px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wallet-card:hover {
    background-color: #1a1b22;
    border-color: #4b5563;
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

.wallet-logo-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    background: #222;
    overflow: hidden;
}

.wallet-logo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.wallet-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #fff;
}

.wallet-card p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --- Footer --- */
footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 40px;
    border-top: 1px solid rgba(255,255,255,0.05);
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: auto;
}

.footer-right {
    display: flex;
    gap: 20px;
}

.footer-right a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-right a:hover {
    color: #fff;
}

/* ===================================================== */
/* --- TEST POPUP MODAL STYLES (connect.html only) --- */
/* ===================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 32px 28px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-box {
    transform: translateY(0);
}

/* Close (X) button */
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid #2e303a;
    color: #9aa0a6;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    z-index: 2;
}

.modal-close:hover {
    background: #1f212a;
    border-color: #4b5563;
    color: #fff;
    transform: rotate(90deg);
}

/* Modal header with logo + title */
.modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 8px;
    padding-right: 40px;
}

.modal-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #222;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.modal-logo .wallet-logo-wrapper {
    width: 48px;
    height: 48px;
    margin: 0;
    border-radius: 12px;
}

.modal-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-box h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0;
    color: #fff;
}

.modal-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
    line-height: 1.4;
    padding-right: 30px;
}

.modal-field {
    margin-bottom: 20px;
}

.modal-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #ccc;
    margin-bottom: 8px;
}

.modal-field textarea {
    width: 100%;
    padding: 16px;
    background: #1a1b22;
    border: 1px solid #2e303a;
    border-radius: 14px;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    outline: none;
    resize: vertical;
    min-height: 140px;
    transition: border 0.2s ease;
}

.modal-field textarea:focus {
    border-color: #5b67f1;
    box-shadow: 0 0 0 3px rgba(91, 103, 241, 0.2);
}

.modal-field textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.modal-actions {
    display: flex;
    justify-content: center;
    margin-top: 28px;
}

.btn-send {
    padding: 14px 48px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 200px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
}

.btn-send:hover:not(:disabled) {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.6);
    transform: translateY(-1px);
}

.btn-send:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    filter: grayscale(0.3);
}

.btn-send.loading {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Environment note under the Send Test button */
.modal-env-note-bottom {
    margin-top: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    text-align: center;
}

/* --- Responsive Design --- */
@media (max-width: 1200px) {
    .wallet-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .grid-container {
        grid-template-columns: 1fr;
    }
    .wallet-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .hero h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 600px) {
    header {
        padding: 15px 20px;
    }
    .hero h1 {
        font-size: 2rem;
    }
    .wallet-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    footer {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 20px;
    }
    .footer-right {
        justify-content: center;
    }
}