:root {
    --bg: #f3f4f6;
    --surface: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eff6ff;
    --success: #16a754;
    --success-soft: #f0fdf4;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 4px 10px -2px rgba(0, 0, 0, 0.04);
    --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

body {
    display: flex;
    justify-content: center;
    padding: 32px 16px;
}

.app {
    width: 100%;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.header {
    text-align: center;
}

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.3px;
}

.logo-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 2px;
}

.subtitle {
    font-size: 13px;
    color: var(--muted);
    margin-top: 4px;
    font-weight: 500;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.tabs {
    position: relative;
    display: flex;
    border-bottom: 1px solid var(--border);
    background: #fafafa;
}

.tab {
    flex: 1;
    padding: 16px 10px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tab:hover {
    color: var(--text);
    background: rgba(0, 0, 0, 0.02);
}

.tab.active {
    color: var(--primary);
    background: var(--surface);
}

.tab-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 50%;
    background: var(--primary);
    transition: transform 0.25s ease;
}

.main {
    padding: 24px;
}

.panel {
    display: none;
}

.panel.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.panel-head {
    margin-bottom: 20px;
}

.panel-head h2 {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 800;
}

.hint {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}

.field {
    margin-bottom: 16px;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

input, select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder, select:invalid {
    color: #9ca3af;
}

input:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn.primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
}

.btn.primary:hover {
    background: var(--primary-dark);
}

.btn.secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn.secondary:hover {
    background: #e5e7eb;
}

.loading {
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    color: var(--muted);
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.deposit-info {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.deposit-info h3 {
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 700;
    color: var(--muted);
}

.accounts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.account-card {
    background: #fafafa;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.account-card:hover {
    border-color: #d1d5db;
    box-shadow: var(--shadow);
}

.account-card img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 50%;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 3px;
}

.account-provider {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 3px;
    color: var(--text);
}

.account-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 4px;
}

.account-phone {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    color: var(--primary);
    margin-bottom: 10px;
}

.copy-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.copy-btn:hover {
    background: var(--bg);
    border-color: #d1d5db;
}

.copy-btn.copied {
    background: var(--success-soft);
    border-color: #bbf7d0;
    color: var(--success);
}

.footer {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.contact-link:hover {
    background: var(--bg);
    border-color: #d1d5db;
}

.hidden { display: none !important; }

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 360px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.2s ease;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.modal-icon {
    font-size: 44px;
    margin-bottom: 12px;
}

.modal.success .modal-content {
    border-top: 3px solid var(--success);
}

.modal.error .modal-content {
    border-top: 3px solid var(--danger);
}

.modal-body {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 20px;
    color: var(--text);
}

.modal-body code {
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
}

.modal-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 12px;
    animation: spin 0.8s linear infinite;
}

.modal .btn {
    margin-top: 0;
    max-width: 180px;
}

@media (max-width: 380px) {
    .field-row {
        grid-template-columns: 1fr;
    }
    .accounts {
        grid-template-columns: 1fr;
    }
    .logo { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
