/* Afghan Services - Modern 2026 Green Design */
:root {
    --primary: #059669;
    --primary-dark: #047857;
    --primary-light: #10B981;
    --primary-soft: #D1FAE5;
    --accent: #34D399;
    --bg: #F0FDF4;
    --bg-card: #FFFFFF;
    --text: #064E3B;
    --text-muted: #6B7280;
    --border: #A7F3D0;
    --danger: #EF4444;
    --warning: #F59E0B;
    --success: #10B981;
    --shadow: 0 4px 20px rgba(5, 150, 105, 0.12);
    --radius: 16px;
    --radius-sm: 10px;
    --font: 'Vazirmatn', Tahoma, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

.hidden { display: none !important; }

/* Splash */
.splash {
    position: fixed;
    inset: 0;
    background: linear-gradient(145deg, #064E3B 0%, #059669 50%, #10B981 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
    transition: opacity 0.5s, visibility 0.5s;
}
.splash.hide {
    opacity: 0;
    visibility: hidden;
}
.logo-circle {
    width: 90px;
    height: 90px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}
.logo-circle svg { width: 50px; height: 50px; }
.logo-circle.small { width: 60px; height: 60px; margin-bottom: 12px; }
.logo-circle.small svg { width: 36px; height: 36px; }
.splash h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: 6px; }
.splash p { opacity: 0.85; font-size: 0.95rem; }

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Auth */
.auth-card {
    max-width: 400px;
    margin: 40px auto;
    background: var(--bg-card);
    border-radius: 24px;
    padding: 32px 24px;
    box-shadow: var(--shadow);
}
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo h2 { font-size: 1.4rem; color: var(--primary-dark); }
.tabs {
    display: flex;
    background: var(--primary-soft);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
}
.tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}
.tab.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.input-group {
    margin-bottom: 16px;
}
.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}
.input-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    background: #F9FFFE;
    transition: border-color 0.2s;
    direction: ltr;
    text-align: right;
}
.input-group input:focus {
    outline: none;
    border-color: var(--primary);
}
.hint {
    font-size: 0.8rem;
    color: var(--primary);
    margin-top: 4px;
    display: block;
}
.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    margin-top: 8px;
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-note {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 20px;
}

/* Main App */
.app-header {
    background: linear-gradient(145deg, #064E3B 0%, #059669 100%);
    color: white;
    padding: 20px 20px 24px;
    border-radius: 0 0 28px 28px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}
.greeting { font-size: 0.9rem; opacity: 0.9; display: block; }
.user-phone { font-weight: 600; font-size: 1.05rem; }
.icon-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.icon-btn svg { width: 22px; height: 22px; }

.balance-card {
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(10px);
    border-radius: 18px;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.2);
}
.balance-info .label { font-size: 0.8rem; opacity: 0.85; display: block; }
.balance-info .amount { font-size: 1.6rem; font-weight: 700; }
.balance-info .amount small { font-size: 0.85rem; font-weight: 400; opacity: 0.9; }
.btn-topup {
    background: white;
    color: var(--primary-dark);
    border: none;
    padding: 10px 16px;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.btn-topup svg { width: 18px; height: 18px; }

.points-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    font-size: 0.85rem;
    opacity: 0.95;
}
.link-btn {
    background: none;
    border: none;
    color: #A7F3D0;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
}

/* Services */
.services-area {
    padding: 24px 16px 100px;
}
.section-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--text);
}
.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 28px;
}
.service-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 22px 16px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.service-card:active { transform: scale(0.97); }
.service-card .icon-wrap {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-soft), #A7F3D0);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}
.service-card .icon-wrap svg {
    width: 28px;
    height: 28px;
    color: var(--primary-dark);
}
.service-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.service-card p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Orders list */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.order-item {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.order-item .info h5 { font-size: 0.9rem; font-weight: 600; }
.order-item .info span { font-size: 0.75rem; color: var(--text-muted); }
.order-status {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}
.status-pending { background: #FEF3C7; color: #92400E; }
.status-completed { background: #D1FAE5; color: #065F46; }
.status-rejected { background: #FEE2E2; color: #991B1B; }
.status-processing { background: #DBEAFE; color: #1E40AF; }
.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 30px;
    font-size: 0.9rem;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
    border-top: 1px solid var(--border);
    z-index: 100;
}
.nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.7rem;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 12px;
    transition: color 0.2s;
}
.nav-item svg { width: 24px; height: 24px; }
.nav-item.active { color: var(--primary); }

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s;
}
.modal {
    background: white;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    border-radius: 24px 24px 0 0;
    overflow: hidden;
    animation: slideUp 0.3s;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.1rem; }
.close-btn {
    background: var(--primary-soft);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.4rem;
    color: var(--primary-dark);
    cursor: pointer;
    line-height: 1;
}
.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 70px);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* Form elements in modal */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 6px; }
.form-group input, .form-group select {
    width: 100%;
    padding: 13px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    background: #F9FFFE;
    direction: ltr;
    text-align: right;
}
.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary);
}
.operator-badge {
    display: inline-block;
    background: var(--primary-soft);
    color: var(--primary-dark);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 6px;
}
.package-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 12px 0;
}
.package-item {
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.package-item.selected {
    border-color: var(--primary);
    background: var(--primary-soft);
}
.package-item .pkg-info h5 { font-size: 0.95rem; }
.package-item .pkg-info span { font-size: 0.75rem; color: var(--text-muted); }
.package-item .pkg-price { font-weight: 700; color: var(--primary-dark); font-size: 1.05rem; }

/* Toast */
.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: #064E3B;
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 0.9rem;
    z-index: 300;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    max-width: 90%;
    text-align: center;
    animation: toastIn 0.3s;
}
.toast.error { background: #991B1B; }
.toast.success { background: #065F46; }
@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* Profile & other pages */
.page-content {
    padding: 20px 16px 100px;
}
.profile-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.profile-avatar {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
}
.menu-list {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: var(--primary-soft); }
.menu-item svg { width: 22px; height: 22px; color: var(--primary); }
.menu-item span { flex: 1; font-weight: 500; }
.menu-item .arrow { color: var(--text-muted); }

/* Responsive */
@media (min-width: 480px) {
    .services-grid { grid-template-columns: repeat(3, 1fr); }
    .modal { border-radius: 24px; margin-bottom: 20px; }
    .modal-overlay { align-items: center; }
}
