/* ========================================
   TextNowSMS — Premium OTP Service CSS
   ======================================== */

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.main-content { flex: 1; }

/* ===== HEADER ===== */
.header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0;
}
.nav-container {
    max-width: 1200px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; height: 64px;
}
.logo {
    display: flex; align-items: center; gap: 10px;
    font-size: 1.25rem; font-weight: 800;
    background: linear-gradient(135deg, #6366f1, #0ea5e9);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.logo-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, #6366f1, #0ea5e9);
    border-radius: 12px; display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; -webkit-text-fill-color: initial;
}
.nav-links { display: flex; gap: 4px; }
.nav-link {
    padding: 8px 16px; border-radius: 10px; font-size: .875rem; font-weight: 500;
    color: #64748b; transition: all .2s;
}
.nav-link:hover { color: #1e293b; background: #f1f5f9; }
.nav-link.active { color: #6366f1; background: #eef2ff; }
.nav-right { display: flex; align-items: center; gap: 12px; }
.balance-box {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 16px; border-radius: 12px;
    background: linear-gradient(135deg, #eef2ff, #e0f2fe);
    font-size: .875rem; color: #475569;
}
.balance-box strong { color: #6366f1; font-size: 1rem; }
.user-menu { position: relative; }
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #0ea5e9);
    border: none; color: #fff; font-weight: 700; font-size: .875rem;
}
.user-dropdown {
    display: none; position: absolute; right: 0; top: 48px;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,.12); min-width: 220px;
    overflow: hidden; z-index: 200;
}
.user-dropdown.show { display: block; animation: fadeIn .2s ease; }
.dropdown-header {
    padding: 16px; border-bottom: 1px solid #f1f5f9;
    display: flex; flex-direction: column;
}
.dropdown-header strong { font-size: .9rem; }
.dropdown-header small { color: #94a3b8; font-size: .75rem; }
.user-dropdown a {
    display: block; padding: 10px 16px; font-size: .875rem; color: #475569;
    transition: background .15s;
}
.user-dropdown a:hover { background: #f8fafc; }
.mobile-toggle { display: none; background: none; border: none; font-size: 1.5rem; color: #475569; }

/* ===== MOBILE MENU ===== */
.mobile-menu {
    display: none; position: fixed; top: 64px; left: 0; right: 0; bottom: 0;
    background: #fff; z-index: 90; padding: 20px;
    flex-direction: column; gap: 4px; overflow-y: auto;
}
.mobile-menu.show { display: flex; }
.mobile-menu a {
    padding: 14px 20px; border-radius: 12px; font-size: 1rem;
    font-weight: 500; color: #475569; transition: background .15s;
}
.mobile-menu a:hover { background: #f1f5f9; }
.mobile-balance {
    padding: 16px 20px; background: linear-gradient(135deg, #eef2ff, #e0f2fe);
    border-radius: 16px; margin-bottom: 12px; font-size: .9rem;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 24px; border-radius: 12px; font-weight: 600; font-size: .9rem;
    border: none; transition: all .2s; cursor: pointer; text-decoration: none;
}
.btn-sm { padding: 8px 16px; font-size: .8rem; border-radius: 10px; }
.btn-lg { padding: 16px 32px; font-size: 1rem; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-primary {
    background: linear-gradient(135deg, #6366f1, #0ea5e9);
    color: #fff; box-shadow: 0 4px 14px rgba(99,102,241,.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(99,102,241,.35); }
.btn-secondary {
    background: #fff; color: #6366f1;
    border: 2px solid #c7d2fe;
}
.btn-secondary:hover { border-color: #818cf8; background: #eef2ff; }
.btn-outline {
    background: transparent; color: #475569;
    border: 2px solid #e2e8f0;
}
.btn-outline:hover { border-color: #94a3b8; background: #f8fafc; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: #22c55e; color: #fff; }
.btn-ghost { background: transparent; color: #64748b; border: none; }
.btn-ghost:hover { background: #f1f5f9; }
.btn:disabled, .btn.loading { opacity: .6; pointer-events: none; }

/* ===== CARDS ===== */
.card {
    background: #fff; border-radius: 20px; border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,.04); transition: all .2s;
}
.card-hover:hover { box-shadow: 0 12px 28px rgba(0,0,0,.08); border-color: #c7d2fe; transform: translateY(-2px); }
.card-header { padding: 20px 24px; border-bottom: 1px solid #f1f5f9; }
.card-body { padding: 24px; }
.card-footer { padding: 16px 24px; border-top: 1px solid #f1f5f9; }

/* ===== FORM ===== */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: .875rem; font-weight: 600; color: #374151; margin-bottom: 8px; }
.form-input {
    width: 100%; padding: 12px 16px; border: 2px solid #e2e8f0;
    border-radius: 12px; font-size: .9rem; background: #f8fafc;
    transition: all .2s; outline: none;
}
.form-input:focus { border-color: #6366f1; background: #fff; box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.form-input.error { border-color: #ef4444; }
.form-hint { font-size: .75rem; color: #94a3b8; margin-top: 6px; }
.form-error { font-size: .8rem; color: #ef4444; margin-top: 4px; }
.input-group { position: relative; }
.input-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: #94a3b8; font-size: 1rem;
}
.input-group .form-input { padding-left: 42px; }

/* ===== BADGES ===== */
.badge {
    display: inline-flex; align-items: center; padding: 4px 12px;
    border-radius: 50px; font-size: .75rem; font-weight: 600;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-default { background: #f1f5f9; color: #475569; }

/* ===== ALERTS ===== */
.alert {
    padding: 16px 20px; border-radius: 14px; margin-bottom: 20px;
    display: flex; align-items: center; gap: 12px; font-size: .9rem;
}
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fef9c3; color: #854d0e; border: 1px solid #fde68a; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; border-radius: 16px; border: 1px solid #e2e8f0; }
table { width: 100%; border-collapse: collapse; }
th {
    padding: 14px 20px; text-align: left; font-size: .75rem;
    font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    color: #64748b; background: #f8fafc;
}
td { padding: 14px 20px; font-size: .875rem; border-top: 1px solid #f1f5f9; }
tr:hover td { background: #fafbfe; }

/* ===== HERO ===== */
.hero {
    background: linear-gradient(135deg, #312e81, #581c87, #0c4a6e);
    padding: 80px 20px; text-align: center; color: #fff;
    position: relative; overflow: hidden;
}
.hero::before {
    content: ''; position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 0L0 0 0 10' fill='none' stroke='white' stroke-opacity='0.05'/%3E%3C/svg%3E");
}
.hero-content { position: relative; max-width: 800px; margin: 0 auto; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; margin-bottom: 16px; line-height: 1.1; }
.hero h1 span {
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero p { font-size: 1.15rem; color: #cbd5e1; margin-bottom: 32px; max-width: 600px; margin-inline: auto; }
.hero-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.stats-row {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
    max-width: 800px; margin: 48px auto 0; text-align: center;
}
.stat-item h3 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 800; }
.stat-item p { font-size: .875rem; color: #94a3b8; }

/* ===== SECTIONS ===== */
.section { padding: 60px 20px; }
.section-header { text-align: center; margin-bottom: 40px; }
.section-header h2 { font-size: 1.75rem; font-weight: 800; color: #0f172a; margin-bottom: 8px; }
.section-header p { color: #64748b; font-size: 1rem; }
.section-white { background: #fff; }
.section-gray { background: #f8fafc; }
.section-gradient {
    background: linear-gradient(135deg, #6366f1, #0ea5e9);
    color: #fff; text-align: center;
}
.section-gradient h2 { color: #fff; }
.section-gradient p { color: rgba(255,255,255,.8); }

/* ===== GRIDS ===== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }

/* ===== SERVICE CARDS ===== */
.service-card { text-align: center; padding: 24px 16px; }
.service-card .icon { font-size: 2.5rem; margin-bottom: 10px; }
.service-card h4 { font-weight: 600; margin-bottom: 4px; }
.service-card .price { color: #6366f1; font-weight: 700; font-size: .9rem; }

.service-list-card {
    padding: 20px; display: flex; flex-direction: column; gap: 12px;
}
.service-list-card .svc-top {
    display: flex; justify-content: space-between; align-items: start;
}
.service-list-card h3 { font-size: 1.05rem; font-weight: 700; }
.service-list-card .svc-price {
    font-size: 1.5rem; font-weight: 800; color: #6366f1;
}
.service-list-card .svc-price small { font-size: .75rem; font-weight: 500; color: #94a3b8; }

/* ===== FEATURE CARDS ===== */
.feature-card { padding: 28px; }
.feature-icon {
    width: 52px; height: 52px; border-radius: 14px;
    background: linear-gradient(135deg, #6366f1, #0ea5e9);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; margin-bottom: 16px;
}
.feature-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.feature-card p { color: #64748b; font-size: .9rem; }

/* ===== STEPS ===== */
.step { text-align: center; padding: 20px; }
.step-num {
    width: 56px; height: 56px; border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #0ea5e9);
    color: #fff; font-size: 1.25rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
}
.step h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.step p { color: #64748b; font-size: .9rem; }

/* ===== PAGE HEADER ===== */
.page-header { margin-bottom: 32px; }
.page-header h1 { font-size: 1.75rem; font-weight: 800; color: #0f172a; margin-bottom: 4px; }
.page-header p { color: #64748b; }

/* ===== DASHBOARD ===== */
.stat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 32px; }
.stat-card { padding: 24px; }
.stat-card .stat-label { font-size: .8rem; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.stat-card .stat-value { font-size: 2rem; font-weight: 800; color: #6366f1; }
.stat-card.gradient { background: linear-gradient(135deg, rgba(99,102,241,.08), rgba(14,165,233,.08)); }

.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
.quick-action {
    display: flex; align-items: center; gap: 16px; padding: 20px;
}
.quick-action .qa-icon {
    width: 48px; height: 48px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; flex-shrink: 0;
}
.qa-icon.blue { background: linear-gradient(135deg, #6366f1, #0ea5e9); }
.qa-icon.purple { background: linear-gradient(135deg, #8b5cf6, #ec4899); }
.qa-icon.red { background: linear-gradient(135deg, #ef4444, #f97316); }
.quick-action h4 { font-weight: 700; margin-bottom: 2px; }
.quick-action p { font-size: .8rem; color: #94a3b8; }

/* ===== OTP DISPLAY ===== */
.otp-code {
    font-size: 2rem; font-weight: 800; letter-spacing: .15em;
    color: #6366f1; font-family: 'Courier New', monospace;
    background: #eef2ff; padding: 12px 24px; border-radius: 12px;
    display: inline-block;
}
.otp-waiting {
    display: flex; align-items: center; gap: 12px;
    color: #f59e0b; font-weight: 600;
}
.otp-waiting .spinner {
    width: 20px; height: 20px; border: 3px solid #fde68a;
    border-top-color: #f59e0b; border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ===== ORDER CARD ===== */
.order-card { margin-bottom: 16px; }
.order-card .card-body {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 16px;
}
.order-info h3 { font-weight: 700; margin-bottom: 4px; }
.order-info p { font-size: .85rem; color: #64748b; }
.order-info .mono { font-family: 'Courier New', monospace; color: #1e293b; }
.order-meta { text-align: right; }
.order-meta .price { font-size: 1.2rem; font-weight: 800; color: #6366f1; }
.order-meta .time { font-size: .75rem; color: #94a3b8; }

/* ===== AUTH PAGES ===== */
.auth-page {
    min-height: calc(100vh - 64px);
    display: flex; align-items: center; justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #eef2ff, #fff, #e0f2fe);
}
.auth-card { width: 100%; max-width: 440px; }
.auth-card .card-body { padding: 32px; }
.auth-header { text-align: center; margin-bottom: 28px; }
.auth-icon {
    width: 64px; height: 64px; border-radius: 20px;
    background: linear-gradient(135deg, #6366f1, #0ea5e9);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; margin: 0 auto 16px;
}
.auth-header h2 { font-size: 1.5rem; font-weight: 800; }
.auth-header p { color: #94a3b8; font-size: .9rem; }
.auth-footer { text-align: center; margin-top: 20px; font-size: .9rem; color: #64748b; }
.auth-footer a { color: #6366f1; font-weight: 600; }

/* ===== SEARCH ===== */
.search-box { position: relative; max-width: 400px; margin-bottom: 24px; }
.search-box input { padding-left: 44px; }
.search-box::before {
    content: '🔍'; position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    font-size: 1rem;
}

/* ===== API DOCS ===== */
.api-section { margin-bottom: 32px; }
.api-endpoint {
    padding: 20px; margin-bottom: 16px;
    border: 1px solid #e2e8f0; border-radius: 14px; background: #fff;
}
.api-method {
    display: inline-block; padding: 4px 10px; border-radius: 6px;
    font-size: .7rem; font-weight: 800; text-transform: uppercase; margin-right: 8px;
}
.api-method.get { background: #dcfce7; color: #166534; }
.api-method.post { background: #fef9c3; color: #854d0e; }
.api-url {
    font-family: 'Courier New', monospace; font-size: .85rem;
    background: #f1f5f9; padding: 10px 16px; border-radius: 8px;
    margin: 12px 0; overflow-x: auto; display: block;
    color: #6366f1; word-break: break-all;
}
.api-response {
    background: #1e293b; color: #e2e8f0; padding: 16px;
    border-radius: 10px; font-family: 'Courier New', monospace;
    font-size: .8rem; overflow-x: auto; white-space: pre;
}
.token-box {
    background: #f8fafc; border: 2px dashed #e2e8f0; border-radius: 12px;
    padding: 20px; display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 24px;
}
.token-box code { font-size: .85rem; word-break: break-all; flex: 1; }

/* ===== COPY BUTTON ===== */
.copy-btn {
    background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 8px 12px; font-size: .8rem; cursor: pointer; transition: all .15s;
}
.copy-btn:hover { background: #e2e8f0; }
.copy-btn.copied { background: #dcfce7; color: #166534; border-color: #bbf7d0; }

/* ===== DEPOSIT ===== */
.deposit-address {
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 14px;
    padding: 20px; margin: 20px 0;
}
.deposit-address code {
    display: block; font-size: .85rem; word-break: break-all;
    background: #fff; padding: 12px; border-radius: 8px; border: 1px solid #e2e8f0;
    margin: 8px 0;
}
.deposit-warning {
    background: #fef9c3; border: 1px solid #fde68a; border-radius: 10px;
    padding: 12px 16px; font-size: .8rem; color: #854d0e; margin-top: 12px;
}

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 60px 20px; color: #94a3b8; }
.empty-state .icon { font-size: 3rem; margin-bottom: 16px; opacity: .5; }
.empty-state p { margin-bottom: 16px; }

/* ===== TABS ===== */
.tabs { display: flex; gap: 4px; margin-bottom: 24px; background: #f1f5f9; padding: 4px; border-radius: 14px; }
.tab {
    flex: 1; padding: 10px; text-align: center; border-radius: 10px;
    font-size: .875rem; font-weight: 600; color: #64748b; cursor: pointer;
    border: none; background: transparent; transition: all .2s;
}
.tab.active { background: #fff; color: #6366f1; box-shadow: 0 2px 8px rgba(0,0,0,.06); }

/* ===== FOOTER ===== */
.footer { background: #0f172a; color: #cbd5e1; padding: 60px 0 30px; }
.footer-grid {
    display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px;
    max-width: 1200px; margin: 0 auto; padding: 0 20px;
}
.footer-brand p { margin-top: 16px; font-size: .875rem; color: #64748b; line-height: 1.6; }
.footer h4 { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #f8fafc; margin-bottom: 16px; }
.footer a { display: block; font-size: .875rem; color: #94a3b8; padding: 4px 0; transition: color .15s; }
.footer a:hover { color: #fff; }
.footer-bottom {
    text-align: center; padding-top: 30px; margin-top: 40px;
    border-top: 1px solid #1e293b; font-size: .8rem; color: #64748b;
}
.footer-bottom .container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ===== TEXT HELPERS ===== */
.text-danger { color: #ef4444 !important; }
.text-success { color: #22c55e !important; }
.text-primary { color: #6366f1 !important; }
.text-muted { color: #94a3b8 !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-mono { font-family: 'Courier New', monospace; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; } .flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
.fade-in { animation: fadeIn .3s ease; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .nav-links { display: none; }
    .balance-box { display: none; }
    .mobile-toggle { display: block; }
    .grid-4, .grid-6 { grid-template-columns: repeat(3, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .stat-cards, .quick-actions { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .hero { padding: 60px 20px; }
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1rem; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .grid-2, .grid-3, .grid-4, .grid-6 { grid-template-columns: 1fr; }
    .stat-cards { grid-template-columns: 1fr; }
    .quick-actions { grid-template-columns: 1fr; }
    .section { padding: 40px 20px; }
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .order-card .card-body { flex-direction: column; align-items: flex-start; }
    .order-meta { text-align: left; }
    .nav-right .btn { display: none; }
    .nav-right .user-avatar { display: flex; }
    .mobile-toggle { display: block; }
    .auth-card .card-body { padding: 24px 20px; }
    .hero-buttons { flex-direction: column; align-items: center; }
    .hero-buttons .btn { width: 100%; max-width: 280px; }
    .api-url { font-size: .75rem; }
    th, td { padding: 10px 12px; font-size: .8rem; }
}

@media (max-width: 480px) {
    .nav-container { padding: 0 12px; }
    .logo span { font-size: 1.05rem; }
    .page-header h1 { font-size: 1.4rem; }
    .stat-card .stat-value { font-size: 1.5rem; }
}
