/* Otentik ID - stylesheet custom, tanpa dependensi eksternal */

:root {
    --color-primary: #1e3a5f;
    --color-primary-dark: #14283f;
    --color-secondary: #4a6785;
    --color-success: #1e7e34;
    --color-success-bg: #e6f4ea;
    --color-danger: #b02a37;
    --color-danger-bg: #fdecea;
    --color-warning-bg: #fff8e1;
    --color-warning-border: #f0c766;
    --color-muted-bg: #eef0f2;
    --color-text: #22282f;
    --color-text-muted: #6b7280;
    --color-border: #dfe3e8;
    --color-bg: #f4f6f8;
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
}

a {
    color: var(--color-primary);
}

.container {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Header */

.site-header {
    background: var(--color-primary);
    color: #fff;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
}

.brand-logo {
    max-height: 40px;
    max-width: 160px;
    object-fit: contain;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #fff;
    color: var(--color-primary);
    font-weight: 700;
    border-radius: 50%;
}

.brand strong {
    display: block;
    font-size: 1.05rem;
}

.brand small {
    display: block;
    font-size: 0.75rem;
    opacity: 0.8;
}

.main-nav {
    display: flex;
    gap: 16px;
}

.main-nav a {
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.9;
}

.main-nav a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Layout */

.page-content {
    padding: 24px 16px 48px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.page-header h1 {
    margin: 0;
}

.card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

.auth-card {
    max-width: 400px;
    margin: 48px auto;
}

/* Forms */

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

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    color: var(--color-text);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.15);
}

textarea {
    resize: vertical;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.filter-bar .form-group {
    margin-bottom: 0;
    flex: 1 1 160px;
}

.form-group-btn {
    flex: 0 0 auto;
}

/* Buttons */

.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}

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

.btn-secondary {
    background: #fff;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-secondary:hover {
    background: #eef2f6;
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
}

.btn-danger:hover {
    background: #8f232d;
}

.btn-link {
    background: transparent;
    color: var(--color-secondary);
    border: none;
    text-decoration: underline;
    padding: 10px 6px;
}

.actions-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 16px 0;
}

/* Stat cards */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 4px;
}

/* Tables */

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

.data-table th {
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--color-text-muted);
}

.text-small {
    font-size: 0.8rem;
}

/* Badges */

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-success {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.badge-danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.badge-muted {
    background: var(--color-muted-bg);
    color: var(--color-text-muted);
}

/* Alerts */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.92rem;
}

.alert ul {
    margin: 0;
    padding-left: 20px;
}

.alert-success {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid #b6dfc0;
}

.alert-error {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border: 1px solid #f1c0c4;
}

.alert-warning {
    background: var(--color-warning-bg);
    color: #8a6100;
    border: 1px solid var(--color-warning-border);
}

/* Detail grid */

.detail-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 8px 16px;
    margin: 0 0 16px;
}

.detail-grid dt {
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 0.85rem;
}

.detail-grid dd {
    margin: 0;
    word-break: break-word;
}

/* Stamp card (issue_success.php) */

.stamp-card {
    max-width: 420px;
    margin: 0 auto 20px;
    text-align: center;
}

.stamp-logo {
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.stamp-logo-img {
    max-height: 56px;
    max-width: 260px;
    object-fit: contain;
    margin: 0 auto 10px;
    display: block;
}

.stamp-kode {
    font-family: "Courier New", monospace;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.qrcode-holder {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.qrcode-holder svg {
    max-width: 220px;
    height: auto;
}

.stamp-detail {
    text-align: left;
    margin: 0 0 12px;
}

.stamp-detail dt {
    color: var(--color-text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    margin-top: 10px;
}

.stamp-detail dd {
    margin: 2px 0 0;
    font-weight: 600;
}

.stamp-url {
    word-break: break-all;
}

/* Verify page (public, mobile-first) */

.verify-wrap {
    max-width: 480px;
    margin: 0 auto;
}

.verify-form-card h1 {
    font-size: 1.3rem;
    margin-top: 0;
}

.scan-area {
    margin-top: 16px;
}

#qr-reader {
    width: 100%;
}

.result-card {
    text-align: center;
    border-width: 2px;
}

.result-card h1 {
    font-size: 1.4rem;
    margin: 8px 0;
}

.result-icon {
    font-size: 2.4rem;
    line-height: 1;
}

.result-card .detail-grid {
    grid-template-columns: 140px 1fr;
    text-align: left;
    margin-top: 16px;
}

.result-valid {
    background: var(--color-success-bg);
    border-color: var(--color-success);
}

.result-valid .result-icon,
.result-valid h1 {
    color: var(--color-success);
}

.result-revoked {
    background: var(--color-warning-bg);
    border-color: var(--color-warning-border);
}

.result-revoked .result-icon,
.result-revoked h1 {
    color: #8a6100;
}

.result-notfound {
    background: var(--color-muted-bg);
    border-color: var(--color-border);
}

.result-notfound .result-icon,
.result-notfound h1 {
    color: var(--color-text-muted);
}

/* Landing page */

.landing-hero {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: #fff;
    padding: 64px 16px 72px;
    text-align: center;
}

.landing-hero-logo {
    margin-bottom: 24px;
}

.landing-hero-logo img {
    max-height: 72px;
    max-width: 280px;
    object-fit: contain;
}

.brand-mark-lg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: #fff;
    color: var(--color-primary);
    font-weight: 800;
    font-size: 2rem;
}

.landing-hero h1 {
    font-size: 2.4rem;
    line-height: 1.2;
    margin: 0 0 16px;
}

.landing-tagline {
    font-size: 1.1rem;
    opacity: 0.92;
    max-width: 640px;
    margin: 0 auto 32px;
}

.landing-hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.landing-hero .btn-primary {
    background: #fff;
    color: var(--color-primary);
}

.landing-hero .btn-primary:hover {
    background: #eef2f6;
}

.landing-hero .btn-secondary {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.6);
}

.landing-hero .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.landing-section {
    padding: 56px 16px;
}

.landing-section-alt {
    background: #fff;
}

.landing-section h2 {
    font-size: 1.7rem;
    text-align: center;
    margin: 0 0 12px;
}

.section-lead {
    text-align: center;
    color: var(--color-text-muted);
    max-width: 640px;
    margin: 0 auto 36px;
}

.why-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.why-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 26px 20px;
    text-align: center;
}

.why-icon {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.why-card h3 {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.why-card p {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 28px;
}

.step {
    text-align: center;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-weight: 700;
    margin-bottom: 14px;
}

.step h3 {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.step p {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.cta-band {
    background: var(--color-primary-dark);
    color: #fff;
    text-align: center;
    padding: 48px 16px;
}

.cta-band h2 {
    margin: 0 0 10px;
    font-size: 1.5rem;
}

.cta-band p {
    margin: 0 0 24px;
    opacity: 0.9;
}

@media (max-width: 640px) {
    .landing-hero {
        padding: 48px 16px 56px;
    }

    .landing-hero h1 {
        font-size: 1.8rem;
    }
}

/* Footer */

.site-footer {
    padding: 20px 16px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.82rem;
}

/* Mobile */

@media (max-width: 640px) {
    .detail-grid,
    .result-card .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-grid dt {
        margin-top: 10px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
