/* ============================================
   Acoverify – Professional Design System
   ============================================ */

:root {
    --primary: #1e40af;
    --primary-hover: #1e3a8a;
    --primary-light: #dbeafe;
    --success: #059669;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;
    --error: #dc2626;
    --error-bg: #fef2f2;
    --error-border: #fecaca;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 10px 20px -5px rgb(0 0 0 / 0.08);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========== Header ========== */
.header {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
}

.header-inner {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-mark {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text);
    letter-spacing: -0.3px;
}

.brand-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.header-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    padding: 6px 12px;
    border-radius: 20px;
}

/* ========== Main ========== */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 20px 40px;
}

.card {
    width: 100%;
    max-width: 480px;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 40px 36px;
}

.card-header {
    margin-bottom: 32px;
    text-align: center;
}

.card-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.4px;
    margin-bottom: 10px;
}

.card-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.55;
}

/* ========== Form ========== */
.verify-form {
    margin-bottom: 8px;
}

.form-group {
    margin-bottom: 24px;
}

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

.input-wrapper input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    font-family: inherit;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
    color: var(--text);
}

.input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.12);
}

.input-wrapper input::placeholder {
    color: #94a3b8;
}

/* ========== Buttons ========== */
.btn-primary {
    width: 100%;
    padding: 15px 20px;
    background: var(--primary);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.25);
}

.btn-primary:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-primary:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.btn-secondary {
    width: 100%;
    padding: 14px 20px;
    background: #ffffff;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-text-only {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
}

.btn-text-only:hover {
    color: var(--error);
}

.btn-loader {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn-loader.hidden {
    display: none;
}

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

/* ========== Divider ========== */
.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.divider span {
    padding: 0 16px;
}

/* ========== QR Reader ========== */
.qr-reader {
    margin-top: 20px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.qr-reader.hidden {
    display: none;
}

#qr-reader video {
    border-radius: 12px;
}

/* ========== Result States ========== */
.result {
    margin-top: 28px;
    padding: 20px 22px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.55;
    animation: fadeIn 0.3s ease;
}

.result.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.result.success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: #065f46;
}

.result.warning {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    color: #92400e;
}

.result.error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: #991b1b;
}

.result-title {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-details {
    display: grid;
    gap: 6px;
    font-size: 0.9rem;
}

.result-details strong {
    font-weight: 600;
}

/* ========== Trust Row ========== */
.trust-row {
    display: flex;
    gap: 28px;
    margin-top: 36px;
    flex-wrap: wrap;
    justify-content: center;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.trust-icon {
    font-size: 0.95rem;
}

/* ========== Footer ========== */
.footer {
    text-align: center;
    padding: 28px 20px 36px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-note {
    margin-top: 6px;
    font-size: 0.8rem;
    opacity: 0.85;
}

/* ========== Responsive ========== */
@media (max-width: 540px) {
    .header {
        padding: 14px 16px;
    }

    .header-badge {
        display: none;
    }

    .main {
        padding: 32px 16px 30px;
    }

    .card {
        padding: 28px 22px;
        border-radius: 14px;
    }

    .card-header h1 {
        font-size: 1.3rem;
    }

    .trust-row {
        gap: 16px 24px;
    }
}
