/* eTaxPDF - Base Stylesheet */

:root {
    --green-dark:  #1a2e1a;
    --green-mid:   #2d5a27;
    --green-light: #4a8c3f;
    --green-pale:  #e8f5e2;
    --gold:        #c9a84c;
    --gold-light:  #f0d080;
    --text-main:   #1a2e1a;
    --text-muted:  #6b7c6b;
    --white:       #ffffff;
    --surface:     #f7faf5;
    --border:      #d4e4cc;
    --danger:      #dc2626;
    --danger-bg:   #fef2f2;
    --radius:      14px;
    --radius-sm:   8px;
    --shadow:      0 4px 24px rgba(26,46,26,0.10);
    --shadow-sm:   0 2px 8px rgba(26,46,26,0.06);
}

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

html { font-size: 16px; }

body {
    font-family: 'Sarabun', sans-serif;
    color: var(--text-main);
    background: var(--surface);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1 { font-size: 24px; font-weight: 600; }
h2 { font-size: 20px; font-weight: 600; }
h3 { font-size: 17px; font-weight: 600; }
h4 { font-size: 15px; font-weight: 600; }
p  { font-size: 15px; }

/* App shell (used in authenticated pages) */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

/* Top nav */
.top-nav {
    background: var(--green-dark);
    color: white;
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-nav .nav-title {
    font-size: 16px;
    font-weight: 600;
    flex: 1;
}

.top-nav .nav-back {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    margin-left: -8px;
    display: flex;
    align-items: center;
}

/* Page content */
.page-content {
    flex: 1;
    padding: 20px 16px;
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
}

/* Bottom nav */
.bottom-nav {
    background: var(--white);
    border-top: 1px solid var(--border);
    display: flex;
    height: 64px;
    position: sticky;
    bottom: 0;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    transition: color 0.2s;
}

.bottom-nav a.active { color: var(--green-light); }
.bottom-nav a svg { width: 22px; height: 22px; }

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 20px;
    border-radius: var(--radius-sm);
    font-family: 'Sarabun', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.1s, opacity 0.2s;
    text-decoration: none;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary   { background: var(--green-dark); color: white; }
.btn-primary:hover { background: var(--green-mid); }

.btn-secondary { background: var(--green-pale); color: var(--green-mid); }
.btn-secondary:hover { background: #d4eece; }

.btn-danger    { background: var(--danger-bg); color: var(--danger); }
.btn-outline   { background: transparent; color: var(--green-mid); border: 1.5px solid var(--border); }

.btn-full { width: 100%; }
.btn-sm   { height: 38px; padding: 0 14px; font-size: 13px; }

/* Form elements */
.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    height: 48px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 14px;
    font-family: 'Sarabun', sans-serif;
    font-size: 15px;
    color: var(--text-main);
    background: var(--surface);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    border-color: var(--green-light);
    box-shadow: 0 0 0 3px rgba(74,140,63,0.12);
    background: var(--white);
}

textarea.form-control {
    height: auto;
    min-height: 100px;
    padding: 12px 14px;
    resize: vertical;
    line-height: 1.6;
}

select.form-control { cursor: pointer; }

/* Alerts */
.alert {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.alert-error   { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; }
.alert-success { background: var(--green-pale); color: var(--green-mid); border: 1px solid #b7d9a8; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-pending  { background: #fffbeb; color: #92400e; }
.badge-active   { background: var(--green-pale); color: var(--green-mid); }
.badge-suspended { background: var(--danger-bg); color: var(--danger); }

/* Status indicator */
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}
.status-dot.pending   { background: #f59e0b; }
.status-dot.active    { background: #22c55e; }
.status-dot.suspended { background: var(--danger); }

/* Divider */
.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 16px 0;
}

/* Loading spinner */
.spinner {
    width: 20px; height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

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

/* Pending overlay — shown when account not yet approved */
.pending-banner {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
}

.pending-banner svg { width: 20px; height: 20px; color: #f59e0b; flex-shrink: 0; margin-top: 1px; }
.pending-banner p   { font-size: 14px; color: #78350f; line-height: 1.5; }

/* Responsive */
@media (min-width: 640px) {
    .page-content { padding: 28px 24px; }
}
