*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #006a4e;
    --primary-dark: #004d38;
    --accent: #f42a41;
    --bg: #f4f7f6;
    --text: #1a2e2a;
    --muted: #4a6360;
    --white: #ffffff;
    --border: #d0deda;
    --radius: 8px;
    --shadow: 0 2px 12px rgba(0,106,78,0.08);
}

body {
    font-family: 'SolaimanLipi', 'Kalpurush', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

nav {
    background: var(--primary);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 62px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

nav .brand {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--white);
    text-decoration: none;
    letter-spacing: 0.01em;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

nav ul a {
    text-decoration: none;
    color: rgba(255,255,255,0.85);
    font-size: 0.95rem;
    transition: color 0.2s;
}

nav ul a:hover {
    color: #fff;
}

main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2.5rem 1rem;
}

.container {
    width: 100%;
    max-width: 640px;
}

.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary);
}

.card-header .icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.card-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.card-header p {
    font-size: 0.82rem;
    color: var(--muted);
}

.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.4rem;
}

label span.req {
    color: var(--accent);
    margin-left: 2px;
}

input[type="text"],
input[type="date"] {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    color: var(--text);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

input[type="text"]:focus,
input[type="date"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,106,78,0.1);
}

input::placeholder {
    color: #aab8b5;
}

.captcha-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.captcha-row img {
    height: 48px;
    border-radius: 6px;
    border: 1.5px solid var(--border);
    background: #f0f0f0;
    cursor: pointer;
}

.captcha-row input {
    flex: 1;
}

.refresh-btn {
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.65rem;
    cursor: pointer;
    color: var(--muted);
    font-size: 1rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.refresh-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0,106,78,0.05);
}

.btn-submit {
    width: 100%;
    padding: 0.8rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: 0.02em;
}

.btn-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-submit:active {
    transform: none;
}

.btn-submit:disabled {
    background: #9bbfb8;
    cursor: not-allowed;
    transform: none;
}

.hint {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 0.3rem;
}

/* Result styles */
.result-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.result-header {
    background: var(--primary);
    color: white;
    padding: 1rem 1.5rem;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-header.error-header {
    background: var(--accent);
}

.result-body {
    padding: 1.5rem;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
}

.result-table tr {
    border-bottom: 1px solid var(--border);
}

.result-table tr:last-child {
    border-bottom: none;
}

.result-table td {
    padding: 0.65rem 0.5rem;
    font-size: 0.92rem;
    vertical-align: top;
}

.result-table td:first-child {
    font-weight: 600;
    color: var(--muted);
    width: 38%;
    white-space: nowrap;
}

.result-table td:last-child {
    color: var(--text);
    font-weight: 500;
}

.alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.alert-error {
    background: #fff0f1;
    border: 1px solid #fdc0c5;
    color: #c0152a;
}

.alert-info {
    background: #f0faf7;
    border: 1px solid #a3d8ca;
    color: #005a42;
}

.badge-valid {
    display: inline-block;
    background: #d4edda;
    color: #155724;
    padding: 0.2rem 0.75rem;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
}

.badge-invalid {
    display: inline-block;
    background: #f8d7da;
    color: #721c24;
    padding: 0.2rem 0.75rem;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
}

.section-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.back-link:hover {
    text-decoration: underline;
}

.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.75);
    z-index: 100;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
}

.loading-overlay.active {
    display: flex;
}

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

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

.loading-text {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.95rem;
}

footer {
    text-align: center;
    padding: 1.25rem;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.82rem;
    background: #fff;
}

footer a {
    color: var(--primary);
    text-decoration: none;
}

@media (max-width: 500px) {
    .card { padding: 1.25rem; }
    .captcha-row { flex-wrap: wrap; }
    nav { padding: 0 1rem; }
    nav .brand { font-size: 1rem; }
}
