.connect-section {
    padding: 80px 0 120px;
    position: relative;
}

.connect-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle 1px at 15% 20%, rgba(0, 168, 255, 0.3), transparent 1px),
        radial-gradient(circle 1px at 85% 80%, rgba(0, 217, 255, 0.25), transparent 1px),
        radial-gradient(circle 1px at 50% 50%, rgba(0, 168, 255, 0.15), transparent 1px);
    background-size: 300px 300px, 350px 350px, 400px 400px;
    background-position: 0 0, 50px 70px, 100px 150px;
    animation: bgShift 60s linear infinite;
    pointer-events: none;
    opacity: 0.4;
}

@keyframes bgShift {
    0% {
        background-position: 0 0, 50px 70px, 100px 150px;
    }
    100% {
        background-position: 300px 300px, 350px 370px, 400px 400px;
    }
}

.connect-intro {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto 80px;
    text-align: center;
}

.connect-title {
    font-size: 56px;
    font-weight: 800;
    letter-spacing: -1.5px;
    margin-bottom: 24px;
    animation: fadeIn 0.8s ease;
}

.connect-description {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.8;
    animation: fadeIn 0.8s ease 0.1s backwards;
}

.connect-security {
    background: linear-gradient(135deg, rgba(0, 168, 255, 0.08), rgba(0, 217, 255, 0.04));
    border: 1px solid rgba(0, 168, 255, 0.2);
    border-radius: 16px;
    padding: 28px;
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.8;
    animation: fadeIn 0.8s ease 0.2s backwards;
}

.wallets-section {
    position: relative;
    z-index: 1;
}

.wallets-title {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
    animation: fadeIn 0.8s ease 0.3s backwards;
}

.wallets-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 48px;
    font-size: 16px;
    animation: fadeIn 0.8s ease 0.4s backwards;
}

.wallets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

.wallet-card {
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 20px;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
}

.wallet-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
    transform: scaleX(0);
    transition: transform 0.4s ease;
    transform-origin: left;
}

.wallet-card:hover::before {
    transform: scaleX(1);
}

.wallet-card:hover {
    background: var(--hover);
    border-color: var(--accent-blue);
    transform: translateY(-12px);
    box-shadow: 0 24px 64px rgba(0, 168, 255, 0.25);
}

.wallet-logo-slot {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, rgba(0, 168, 255, 0.1), rgba(0, 217, 255, 0.05));
    border: 2px solid var(--border);
    border-radius: 16px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.wallet-logo-slot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    padding: 8px;
}

.wallet-card:hover .wallet-logo-slot {
    background: linear-gradient(135deg, rgba(0, 168, 255, 0.2), rgba(0, 217, 255, 0.1));
    border-color: var(--accent-cyan);
    transform: scale(1.08);
}

.wallet-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.4;
}

.modal-loading {
    max-width: 500px;
}

.loading-container {
    text-align: center;
    padding: 20px;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    margin: 0 auto 32px;
    border: 4px solid rgba(0, 168, 255, 0.2);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 2s linear infinite;
}

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

.modal-loading h3 {
    font-size: 28px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.loading-text {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.loading-notice {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.7;
    background: linear-gradient(135deg, rgba(0, 168, 255, 0.05), transparent);
    border-left: 3px solid var(--accent-cyan);
    padding: 16px;
    border-radius: 8px;
}

.modal-phrase {
    max-width: 600px;
}

.phrase-instruction {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 28px;
    line-height: 1.7;
    background: rgba(0, 217, 255, 0.05);
    padding: 16px;
    border-radius: 12px;
    border-left: 3px solid var(--accent-cyan);
}

.phrase-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.phrase-input-wrapper {
    background: var(--tertiary-bg);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s ease;
}

.phrase-input-wrapper:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(0, 168, 255, 0.1);
}

.phrase-display {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 40px;
    align-content: flex-start;
}

.phrase-word {
    background: linear-gradient(135deg, rgba(0, 168, 255, 0.1), rgba(0, 217, 255, 0.05));
    border: 1px solid var(--accent-blue);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: wordBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes wordBounce {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.phrase-word-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 700;
}

.phrase-word-remove:hover {
    background: var(--error);
    color: white;
}

.phrase-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    flex: 1;
    min-height: 40px;
}

.phrase-input::placeholder {
    color: var(--text-muted);
}

.word-count-info {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 12px;
    background: rgba(0, 168, 255, 0.05);
    border-radius: 8px;
}

.word-count-info span {
    color: var(--accent-cyan);
}

.modal-success {
    max-width: 550px;
    text-align: center;
}

.success-animation {
    margin-bottom: 32px;
}

.success-checkmark {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    perspective: 1000px;
}

.success-checkmark svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 8px 24px rgba(16, 185, 129, 0.3));
}

@keyframes drawCircle {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes drawCheck {
    to {
        stroke-dashoffset: 0;
    }
}

.modal-success h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.success-wallet-name {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.reference-container {
    background: linear-gradient(135deg, rgba(0, 168, 255, 0.08), rgba(0, 217, 255, 0.04));
    border: 1px solid rgba(0, 168, 255, 0.2);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 28px;
}

.reference-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.reference-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--secondary-bg);
    border: 2px solid var(--success);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.reference-box:hover {
    background: var(--tertiary-bg);
    box-shadow: 0 12px 32px rgba(16, 185, 129, 0.2);
}

.reference-number {
    font-size: 28px;
    font-weight: 800;
    color: var(--success);
    letter-spacing: 2px;
    font-family: 'Space Mono', monospace;
}

.copy-btn {
    background: none;
    border: none;
    color: var(--success);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: rgba(16, 185, 129, 0.1);
    transform: scale(1.1);
}

.reference-hint {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

.success-footer {
    font-size: 14px;
    color: var(--success);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 24px;
    text-transform: uppercase;
}

.btn-full {
    width: 100%;
}

@media (max-width: 768px) {
    .connect-title {
        font-size: 36px;
    }

    .wallets-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 16px;
    }

    .wallet-card {
        padding: 24px 16px;
    }

    .wallet-logo-slot {
        width: 80px;
        height: 80px;
    }

    .wallet-name {
        font-size: 12px;
    }

    .modal-success {
        max-width: 90vw;
    }
}

@media (max-width: 480px) {
    .connect-title {
        font-size: 28px;
    }

    .wallets-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }

    .wallet-card {
        padding: 20px 12px;
    }

    .wallet-logo-slot {
        width: 70px;
        height: 70px;
    }

    .wallet-name {
        font-size: 11px;
    }

    .reference-number {
        font-size: 20px;
        letter-spacing: 1px;
    }

    .modal-content {
        padding: 24px;
    }
}

.wallets-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
}

.wallet-card {
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 20px;
    padding: 40px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
}

.wallet-logo-slot {
    width: 140px;
    height: 140px;
    background: linear-gradient(135deg, rgba(0, 168, 255, 0.1), rgba(0, 217, 255, 0.05));
    border: 2px solid var(--border);
    border-radius: 16px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.wallet-logo-slot img {
    width: 90%;
    height: 90%;
    object-fit: contain;
    object-position: center;
}

.wallet-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.4;
}

/* Tablet view - 3 columns */
@media (max-width: 1024px) {
    .wallets-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }

    .wallet-card {
        padding: 36px 24px;
    }

    .wallet-logo-slot {
        width: 130px;
        height: 130px;
    }
}

/* Mobile view - 3 columns (as you requested) */
@media (max-width: 768px) {
    .wallets-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    .wallet-card {
        padding: 24px 16px;
    }

    .wallet-logo-slot {
        width: 100px;
        height: 100px;
    }

    .wallet-name {
        font-size: 12px;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .wallet-logo-slot {
        width: 70px;
        height: 70px;
    }
}

.method-toggle {
    display: flex;
    gap: 8px;
    margin: 20px 0;
    background: #f5f5f5;
    padding: 4px;
    border-radius: 8px;
}

.method-btn {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    color: #666;
}

.method-btn:hover {
    background: #e0e0e0;
}

.method-btn.method-active {
    background: white;
    color: #2563eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.method-section {
    display: none;
}

.method-section.active {
    display: block;
}

.passkey-info {
    margin-top: 8px;
    font-size: 12px;
    color: #999;
}
