/* ============================================================
   Wallet Connect — Modal & Notification Styles
   ============================================================
   Neutral color palette. Dark overlay, clean white card,
   subtle animations. Responsive down to 320px.
   No external dependencies.
   ============================================================ */

/* ── CSS Variables (Neutral Palette) ───────────────────── */
:root {
    --wc-bg:             #f4f4f5;
    --wc-surface:        #ffffff;
    --wc-text:           #1a1a2e;
    --wc-text-secondary: #71717a;
    --wc-text-muted:     #a1a1aa;
    --wc-accent:         #3f3f46;
    --wc-accent-hover:   #27272a;
    --wc-border:         #d4d4d8;
    --wc-border-light:   #e4e4e7;
    --wc-overlay:        rgba(0, 0, 0, 0.55);
    --wc-danger:         #ef4444;
    --wc-danger-bg:      #fef2f2;
    --wc-success:        #16a34a;
    --wc-success-bg:     #f0fdf4;
    --wc-radius:         12px;
    --wc-radius-sm:      8px;
    --wc-shadow:         0 4px 32px rgba(0, 0, 0, 0.12);
    --wc-font:           -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --wc-font-mono:      'SF Mono', 'Fira Code', 'Fira Mono', Menlo, Consolas, monospace;
    --wc-transition:     0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Modal Overlay ─────────────────────────────────────── */
.wc-overlay {
    position: fixed;
    inset: 0;
    z-index: 99990;
    background: var(--wc-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--wc-transition), visibility var(--wc-transition);
}

.wc-overlay.wc--open {
    opacity: 1;
    visibility: visible;
}

/* ── Modal Card ────────────────────────────────────────── */
.wc-modal {
    background: var(--wc-surface);
    border-radius: var(--wc-radius);
    box-shadow: var(--wc-shadow);
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    overflow-y: auto;
    font-family: var(--wc-font);
    color: var(--wc-text);
    position: relative;
    transform: scale(0.92) translateY(12px);
    transition: transform var(--wc-transition);
}

.wc-overlay.wc--open .wc-modal {
    transform: scale(1) translateY(0);
}

/* ── Modal Header ──────────────────────────────────────── */
.wc-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px 0;
}

.wc-modal__title {
    font-size: 20px;
    font-weight: 600;
    color: var(--wc-text);
    margin: 0;
    letter-spacing: -0.3px;
}

.wc-modal__subtitle {
    padding: 6px 28px 0;
    font-size: 13px;
    color: var(--wc-text-secondary);
    margin: 0;
    line-height: 1.5;
}

.wc-modal__close {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--wc-text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--wc-transition), color var(--wc-transition);
    line-height: 1;
    flex-shrink: 0;
}

.wc-modal__close:hover {
    background: #f4f4f5;
    color: var(--wc-text);
}

/* ── Modal Body / Form ─────────────────────────────────── */
.wc-modal__body {
    padding: 24px 28px 28px;
}

.wc-form-group {
    margin-bottom: 20px;
}

.wc-form-group:last-of-type {
    margin-bottom: 24px;
}

.wc-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--wc-text);
    margin-bottom: 6px;
    letter-spacing: -0.1px;
}

.wc-label__hint {
    font-weight: 400;
    color: var(--wc-text-muted);
    font-size: 12px;
}

.wc-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    font-family: var(--wc-font);
    color: var(--wc-text);
    background: #fafafa;
    border: 1.5px solid var(--wc-border-light);
    border-radius: var(--wc-radius-sm);
    outline: none;
    box-sizing: border-box;
    transition: border-color var(--wc-transition), box-shadow var(--wc-transition), background var(--wc-transition);
}

.wc-input:focus {
    border-color: var(--wc-accent);
    box-shadow: 0 0 0 3px rgba(63, 63, 70, 0.08);
    background: var(--wc-surface);
}

.wc-input--mono {
    font-family: var(--wc-font-mono);
    font-size: 13px;
    line-height: 1.7;
    min-height: 110px;
    resize: vertical;
}

.wc-input--error {
    border-color: var(--wc-danger);
    background: var(--wc-danger-bg);
}

.wc-input--error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.wc-error {
    display: none;
    font-size: 12px;
    color: var(--wc-danger);
    margin-top: 5px;
    align-items: center;
    gap: 4px;
}

.wc-error.wc--visible { display: flex; }

.wc-counter {
    display: flex;
    justify-content: flex-end;
    font-size: 11px;
    color: var(--wc-text-muted);
    margin-top: 4px;
    transition: color var(--wc-transition);
}

.wc-counter.wc--warn { color: var(--wc-danger); }

/* ── Submit Button ─────────────────────────────────────── */
.wc-btn {
    width: 100%;
    padding: 13px 20px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--wc-font);
    color: #ffffff;
    background: var(--wc-accent);
    border: none;
    border-radius: var(--wc-radius-sm);
    cursor: pointer;
    transition: background var(--wc-transition), transform var(--wc-transition), box-shadow var(--wc-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    letter-spacing: -0.1px;
}

.wc-btn:hover {
    background: var(--wc-accent-hover);
    box-shadow: 0 2px 12px rgba(39, 39, 42, 0.2);
}

.wc-btn:active {
    transform: scale(0.98);
}

.wc-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ── Loading Spinner ───────────────────────────────────── */
.wc-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: wc-spin 0.6s linear infinite;
}

.wc-btn--loading .wc-spinner { display: inline-block; }
.wc-btn--loading .wc-btn__text { /* keep text */ }

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

/* ── Toast Notification ────────────────────────────────── */
.wc-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 99999;
    background: var(--wc-surface);
    border-radius: var(--wc-radius-sm);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 380px;
    font-family: var(--wc-font);
    transform: translateX(calc(100% + 40px));
    transition: transform var(--wc-transition);
    border-left: 4px solid var(--wc-success);
}

.wc-toast.wc--show {
    transform: translateX(0);
}

.wc-toast__icon {
    width: 22px;
    height: 22px;
    background: var(--wc-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    animation: wc-pop-in 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.1s both;
}

.wc-toast__icon svg {
    width: 13px;
    height: 13px;
    color: #ffffff;
}

.wc-toast__content {
    flex: 1;
}

.wc-toast__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--wc-text);
    margin: 0;
    line-height: 1.3;
}

.wc-toast__msg {
    font-size: 12px;
    color: var(--wc-text-secondary);
    margin: 2px 0 0;
    line-height: 1.4;
}

@keyframes wc-pop-in {
    0%   { transform: scale(0); }
    100% { transform: scale(1); }
}

@keyframes wc-toast-out {
    0%   { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(calc(100% + 40px)); opacity: 0; }
}

/* ── Body Scroll Lock ──────────────────────────────────── */
body.wc--no-scroll {
    overflow: hidden;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 520px) {
    .wc-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .wc-modal {
        max-width: 100%;
        border-radius: var(--wc-radius) var(--wc-radius) 0 0;
        max-height: 88vh;
    }

    .wc-modal__header {
        padding: 20px 20px 0;
    }

    .wc-modal__subtitle {
        padding: 6px 20px 0;
    }

    .wc-modal__body {
        padding: 20px 20px 24px;
    }

    .wc-toast {
        top: 12px;
        right: 12px;
        left: 12px;
        max-width: none;
    }
}
