/* ==========================================================================
   APN certificate-signing page — locally authored styles.
   No remote stylesheets are referenced (per REQUIREMENTS.md "Modernize /
   change"). Roboto is loaded from Google Fonts as a third-party web font.
   ========================================================================== */

:root {
    --tm-red: #d71920;
    --tm-red-dark: #b3141a;
    --tm-dark: #14152b;
    --tm-dark-2: #0c0d1c;
    --tm-text: #1d1f2b;
    --tm-muted: #5b6170;
    --tm-border: #c9ced8;
    --tm-border-focus: #14152b;
    --tm-error: #c0392b;
    --tm-bg: #f4f5f7;
    --tm-maxw: 760px;
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    color: var(--tm-text);
    background: var(--tm-bg);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: var(--tm-red);
}

/* ----- Header ----------------------------------------------------------- */
.site-header {
    background: var(--tm-dark);
}

.site-header__inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
}

.site-header__logo {
    display: inline-flex;
    align-items: center;
}

.site-header__logo img {
    display: block;
    height: 32px;
    width: auto;
}

/* ----- Main ------------------------------------------------------------- */
.site-main {
    flex: 1 0 auto;
    width: 100%;
}

.apn {
    padding: 48px 20px 64px;
}

.apn__container {
    max-width: var(--tm-maxw);
    margin: 0 auto;
    background: #fff;
    border: 1px solid #e3e6eb;
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 1px 3px rgba(20, 21, 43, 0.06);
}

.apn__title {
    font-size: 1.85rem;
    line-height: 1.25;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--tm-text);
}

.apn__intro {
    margin: 0 0 16px;
    color: var(--tm-muted);
}

.apn__required-note {
    margin: 0 0 28px;
    font-size: 0.875rem;
    color: var(--tm-muted);
}

/* ----- Form ------------------------------------------------------------- */
.apn-form__row {
    margin-bottom: 22px;
}

.apn-form__label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
}

.apn-form__hint {
    display: inline;
    font-weight: 400;
    font-size: 0.8125rem;
    color: var(--tm-muted);
    margin-left: 6px;
}

.apn-form__note {
    font-size: 0.8125rem;
    color: var(--tm-muted);
    background: #f7f8fa;
    border-left: 3px solid var(--tm-border);
    padding: 10px 12px;
    margin: 0 0 10px;
    border-radius: 0 4px 4px 0;
}

.apn-form__note code {
    font-size: 0.78rem;
    word-break: break-all;
}

.apn-form__control {
    width: 100%;
    padding: 11px 12px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--tm-text);
    background: #fff;
    border: 1px solid var(--tm-border);
    border-radius: 4px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.apn-form__control:focus {
    outline: none;
    border-color: var(--tm-border-focus);
    box-shadow: 0 0 0 3px rgba(20, 21, 43, 0.12);
}

.apn-form__control.is-invalid {
    border-color: var(--tm-error);
}

.apn-form__textarea {
    resize: vertical;
    min-height: 180px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.85rem;
    line-height: 1.45;
}

.apn-form__error {
    display: block;
    margin-top: 6px;
    font-size: 0.8125rem;
    color: var(--tm-error);
}

/* checkbox */
.apn-form__row--check {
    margin-top: 4px;
}

.apn-form__checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.apn-form__checkbox input {
    margin-top: 3px;
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    accent-color: var(--tm-red);
}

.apn-form__privacy {
    font-size: 0.875rem;
    color: var(--tm-muted);
    margin: 22px 0 28px;
}

.apn-form__actions {
    margin-top: 8px;
}

.apn-form__submit {
    appearance: none;
    border: 0;
    background: var(--tm-red);
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 13px 40px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.apn-form__submit:hover {
    background: var(--tm-red-dark);
}

.apn-form__submit:focus-visible {
    outline: 3px solid rgba(215, 25, 32, 0.4);
    outline-offset: 2px;
}

/* ----- General form alert (testac / KMS / server errors) ---------------- */
.apn-form__alert {
    margin: 0 0 24px;
    padding: 14px 16px;
    font-size: 0.9rem;
    color: #842029;
    background: #fdeceb;
    border: 1px solid #f3b9b6;
    border-left: 4px solid var(--tm-error);
    border-radius: 4px;
}

/* ----- Thank-you / confirmation page ------------------------------------ */
.ty-wrapper {
    text-align: center;
    padding: 8px 0 16px;
}

.ty-wrapper h1 {
    font-size: 1.85rem;
    font-weight: 700;
    margin: 0 0 24px;
    color: var(--tm-text);
}

.ty-success-checkmark {
    width: 88px;
    height: 88px;
    margin: 0 auto 24px;
    border-radius: 50%;
    background: #1e9e57;
    position: relative;
}

.ty-success-checkmark::after {
    content: "";
    position: absolute;
    top: 46%;
    left: 50%;
    width: 22px;
    height: 44px;
    border: solid #fff;
    border-width: 0 6px 6px 0;
    transform: translate(-50%, -55%) rotate(45deg);
}

.ty-success-msg-wrapper {
    margin: 0 auto 28px;
    max-width: 520px;
}

.ty-success-msg-wrapper h4 {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0 0 12px;
    color: var(--tm-text);
}

.ty-success-msg {
    margin: 0;
    color: var(--tm-muted);
}

.ty-download {
    display: inline-block;
    background: var(--tm-red);
    color: #fff;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 13px 32px;
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

.ty-download:hover {
    background: var(--tm-red-dark);
}

.ty-download:focus-visible {
    outline: 3px solid rgba(215, 25, 32, 0.4);
    outline-offset: 2px;
}

.ty-back {
    margin: 20px 0 0;
    font-size: 0.9rem;
}

/* ----- Footer ----------------------------------------------------------- */
.site-footer {
    flex-shrink: 0;
    background: var(--tm-dark-2);
    color: #cfd2db;
}

.site-footer__inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 20px;
}

.site-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    margin-bottom: 14px;
}

.site-footer__links a {
    color: #e7e9ef;
    text-decoration: none;
    font-size: 0.875rem;
}

.site-footer__links a:hover {
    text-decoration: underline;
}

.site-footer__copyright {
    margin: 0;
    font-size: 0.75rem;
    color: #8b909e;
}

/* ----- Responsive ------------------------------------------------------- */
@media (max-width: 640px) {
    .apn {
        padding: 28px 14px 48px;
    }

    .apn__container {
        padding: 24px 18px;
    }

    .apn__title {
        font-size: 1.45rem;
    }

    .apn-form__submit {
        width: 100%;
    }
}
