:root {
    --primary-color: #0f5aa6;
    --primary-dark: #08345f;
    --secondary-color: #f5b82e;
    --accent-color: #0f766e;
    --text-color: #162033;
    --muted-color: #667085;
    --light-bg: #f4f7fb;
    --white: #ffffff;
    --border: #d9e2ef;
    --shadow: 0 18px 45px rgba(18, 36, 64, 0.14);
    --radius: 10px;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
}

body {
    font-family: 'Outfit', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-color);
    background:
        radial-gradient(circle at top left, rgba(15, 90, 166, 0.12), transparent 34rem),
        linear-gradient(180deg, #f7faff 0%, var(--light-bg) 48%, #eef4fb 100%);
    margin: 0;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

.hero {
    position: relative;
    color: white;
    padding: max(1rem, env(safe-area-inset-top)) 1rem 6.5rem;
    text-align: center;
    background:
        linear-gradient(135deg, rgba(8, 52, 95, 0.96), rgba(15, 90, 166, 0.94)),
        linear-gradient(45deg, #0f5aa6, #0f766e);
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto -10% -35% -10%;
    height: 55%;
    background: rgba(255, 255, 255, 0.08);
    transform: rotate(-3deg);
}

.hero-compact {
    padding-bottom: 4.5rem;
}

.hero-top {
    position: relative;
    z-index: 1;
    max-width: 1060px;
    margin: 0 auto 3.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.brand-mark {
    display: inline-flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: white;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: 0;
    backdrop-filter: blur(12px);
}

.public-brand-mark.has-brand-logo {
    width: clamp(92px, 18vw, 190px);
    height: 64px;
    padding: 0.35rem 0.55rem;
    background: rgba(255, 255, 255, 0.96);
}

.public-brand-mark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 0 auto;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 0.75rem;
    color: #fde68a;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.hero h1 {
    font-size: clamp(2rem, 7vw, 4.4rem);
    line-height: 1;
    margin: 0 0 1rem;
}

.hero p {
    font-size: clamp(1rem, 3vw, 1.35rem);
    opacity: 0.94;
    margin: 0;
}

.container {
    width: min(940px, calc(100% - 2rem));
    margin: -3.2rem auto 3rem;
    position: relative;
    z-index: 2;
}

.search-box,
.cert-card,
.no-found {
    background: var(--white);
    border: 1px solid rgba(217, 226, 239, 0.92);
    box-shadow: var(--shadow);
}

.search-box {
    padding: clamp(1.25rem, 5vw, 2.5rem);
    border-radius: var(--radius);
}

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

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.55rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="search"],
select {
    width: 100%;
    min-height: 48px;
    padding: 0.95rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    color: var(--text-color);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.skip-link {
    position: fixed;
    z-index: 1000;
    top: 0.5rem;
    left: 0.5rem;
    transform: translateY(-160%);
    background: #fff;
    color: var(--primary-dark);
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-weight: 800;
}

.skip-link:focus {
    transform: translateY(0);
}

input:focus,
select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(15, 90, 166, 0.14);
    outline: none;
}

.btn {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    background: var(--primary-color);
    color: white;
    padding: 0.9rem 1.45rem;
    border: none;
    border-radius: 8px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
    text-align: center;
    touch-action: manipulation;
}

.btn:hover,
.btn:focus-visible {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 90, 166, 0.2);
}

.btn-secondary {
    background: #fff7df;
    color: #6b4300;
    border: 1px solid #f5d37a;
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
    background: #f8e4a8;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
}

.privacy-note,
.form-group small {
    color: var(--muted-color);
}

.privacy-note {
    margin: 0 0 1.25rem;
}

.form-group small {
    display: block;
    margin-top: 0.4rem;
}

.alert {
    padding: 1rem 1.15rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-weight: 700;
}

.alert-error {
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.alert-success {
    color: #047857;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

.results-list {
    margin-top: 2rem;
}

.results-list h2 {
    font-size: clamp(1.35rem, 4vw, 1.8rem);
}

.cert-card {
    padding: 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    gap: 1.25rem;
    align-items: center;
    border-left: 5px solid var(--primary-color);
}

.cert-info h3 {
    margin: 0 0 0.45rem;
    font-size: 1.08rem;
}

.cert-info {
    flex: 1;
    min-width: 0;
}

.cert-info p {
    margin: 0.15rem 0;
    color: var(--muted-color);
    font-size: 0.94rem;
}

.cert-actions {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.certificate-formats {
    display: grid;
    gap: 0.65rem;
    width: min(100%, 430px);
}

.format-actions {
    display: grid;
    grid-template-columns: 3rem repeat(2, minmax(92px, 1fr));
    align-items: center;
    gap: 0.5rem;
}

.format-actions strong {
    color: var(--muted-color);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

.btn-small {
    min-height: 40px;
    padding: 0.6rem 0.85rem;
    font-size: 0.86rem;
}

.no-found {
    text-align: center;
    padding: clamp(1.5rem, 5vw, 3rem);
    border-radius: var(--radius);
}

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

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

.validation-results {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
}

.validation-results > h2 {
    margin-bottom: 0;
}

.validation-result-card {
    margin: 0;
}

.status-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    font-weight: 800;
}

.status-ok {
    color: #047857;
    background: #d1fae5;
}

.status-error {
    color: #b91c1c;
    background: #fee2e2;
}

.certificate-details {
    display: grid;
    gap: 0.85rem;
    margin: 1.5rem 0;
    text-align: left;
}

.certificate-details div {
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
}

.certificate-details dt {
    color: var(--muted-color);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
}

.certificate-details dd {
    margin: 0.2rem 0 0;
    font-weight: 700;
}

.certificate-details-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
}

.certificate-details-grid div:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.status-label {
    display: inline-flex;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
}

.status-valid {
    color: #047857;
    background: #d1fae5;
}

.status-revoked {
    color: #991b1b;
    background: #fee2e2;
}

.status-expired {
    color: #854d0e;
    background: #fef3c7;
}

.language-switcher {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: inherit;
}

.language-switcher label {
    font-size: 0.82rem;
    font-weight: 800;
}

.language-switcher select {
    min-height: 40px;
    width: auto;
    max-width: 150px;
    padding: 0.45rem 2rem 0.45rem 0.7rem;
    border-color: rgba(255, 255, 255, 0.28);
    color: inherit;
    background: rgba(255, 255, 255, 0.12);
}

.language-switcher option {
    color: #162033;
}

.language-submit {
    min-height: 40px;
    border: 1px solid currentColor;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font-weight: 800;
}

.install-page {
    min-height: 100vh;
    padding: 1rem;
    display: grid;
    place-items: center;
}

.install-card {
    width: min(860px, 100%);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: clamp(1.25rem, 4vw, 2.5rem);
}

.install-card h1 {
    margin-top: 0;
    line-height: 1.15;
}

.install-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.install-top .language-switcher {
    color: var(--text-color);
}

.install-top .language-switcher select {
    color: var(--text-color);
    border-color: var(--border);
    background: #fff;
}

.brand-solid {
    background: var(--primary-color);
}

.requirements-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.65rem;
}

.requirements-list li {
    padding: 0.7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.requirement-ok {
    color: #047857;
    background: #ecfdf5;
}

.requirement-error {
    color: #991b1b;
    background: #fef2f2;
}

footer {
    text-align: center;
    padding: 2rem 1rem max(2rem, env(safe-area-inset-bottom));
    font-size: 0.92rem;
    color: var(--muted-color);
}

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

.animate-up {
    animation: fadeInUp 0.5s ease-out both;
}

@media (max-width: 700px) {
    .hero {
        padding-bottom: 5.4rem;
    }

    .hero-top {
        margin-bottom: 2.25rem;
        align-items: flex-start;
    }

    .public-brand-mark.has-brand-logo {
        width: min(42vw, 150px);
        height: 58px;
    }

    .language-switcher {
        flex-direction: column;
        align-items: flex-end;
        gap: 0.25rem;
    }

    .container {
        width: min(100% - 1rem, 940px);
        margin-top: -3.7rem;
    }

    .cert-card {
        align-items: stretch;
        flex-direction: column;
    }

    .cert-actions,
    .cert-actions .btn,
    .search-box .btn,
    .no-found .btn {
        width: 100%;
    }

    .format-actions {
        grid-template-columns: 1fr 1fr;
    }

    .format-actions strong {
        grid-column: 1 / -1;
    }

    .certificate-details-grid {
        grid-template-columns: 1fr;
    }

    .certificate-details-grid div:last-child:nth-child(odd) {
        grid-column: auto;
    }

    .install-top {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
