:root {
    --bg: #07111f;
    --panel: #0e1b2c;
    --panel-2: #14243a;
    --line: #28425f;
    --text: #eef6ff;
    --muted: #9fb2c7;
    --accent: #28a0c9;
    --accent-strong: #38bfd8;
    --danger: #db5c65;
    --success: #38b56b;
}

* {
    box-sizing: border-box;
}

body {
    position: relative;
    min-height: 100vh;
    margin: 0;
    padding: 24px;
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at 18% 18%, rgba(40, 160, 201, 0.22), transparent 30%),
        radial-gradient(circle at 82% 74%, rgba(56, 181, 107, 0.13), transparent 34%),
        linear-gradient(135deg, #06101d 0%, #0a1829 48%, #08111f 100%);
    display: flex;
    align-items: center;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 76%);
}

a {
    color: var(--accent-strong);
}

a:hover,
a:focus {
    color: #75e7f5;
}

.app-shell {
    position: relative;
    z-index: 1;
    width: min(980px, 100%);
    margin: 0 auto;
    border: 1px solid rgba(56, 191, 216, 0.28);
    border-radius: 8px;
    background: rgba(14, 27, 44, 0.9);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
    overflow: hidden;
    backdrop-filter: blur(10px);
    animation: shell-enter 360ms ease both;
}

.brand-panel {
    min-height: 150px;
    padding: 30px 32px;
    background: #101c28;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.brand-panel img {
    display: block;
    width: min(180px, 70vw);
    height: auto;
}

.content-panel {
    padding: 42px;
    background: rgba(9, 22, 38, 0.94);
}

.content-panel-narrow {
    max-width: 860px;
    margin: 0 auto;
}

h1,
h2,
h3 {
    color: #fff;
    letter-spacing: 0;
}

h1 {
    margin: 0 0 12px;
    font-size: 32px;
    line-height: 1.1;
    font-weight: 700;
}

h2 {
    margin-top: 0;
    font-size: 24px;
}

h3 {
    font-size: 20px;
}

p,
li,
.lead,
.form-text {
    color: var(--muted);
    line-height: 1.6;
}

.application-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 26px;
}

.application-card,
.section-panel {
    border: 1px solid rgba(56, 191, 216, 0.22);
    border-radius: 8px;
    background: rgba(14, 27, 44, 0.86);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.2);
}

.application-card {
    min-height: 210px;
    padding: 22px;
    display: flex;
    flex-direction: column;
}

.application-card h2 {
    font-size: 22px;
}

.section-panel {
    padding: 24px;
    margin: 22px 0;
}

.section-panel p:last-child,
.section-panel ul:last-child {
    margin-bottom: 0;
}

.required-note {
    font-weight: 700;
    color: #d8e9f4;
}

.back-link {
    display: inline-block;
    margin-bottom: 24px;
    font-weight: 700;
    text-decoration: none;
}

.page-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 28px;
}

.secondary-link {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(56, 191, 216, 0.34);
    border-radius: 6px;
    padding: 8px 14px;
    color: #d8e9f4;
    background: rgba(14, 27, 44, 0.62);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.secondary-link:hover,
.secondary-link:focus {
    border-color: var(--accent-strong);
    color: #fff;
    background: rgba(36, 154, 187, 0.22);
}

label,
.form-label {
    font-size: 13px;
    font-weight: 700;
    color: #d8e9f4;
}

.form-control,
.form-select {
    min-height: 48px;
    border: 1px solid #345574;
    border-radius: 6px;
    color: var(--text);
    background-color: #081625;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent-strong);
    color: var(--text);
    background-color: #0a192b;
    box-shadow: 0 0 0 3px rgba(56, 191, 216, 0.18);
}

.form-control::placeholder {
    color: #6f849b;
}

.form-select option {
    color: #0a192b;
}

.btn-primary,
.app-button {
    min-height: 48px;
    border: 1px solid #37afcf;
    border-radius: 6px;
    padding: 11px 18px;
    background: #218aae;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.btn-primary:hover,
.btn-primary:focus,
.app-button:hover,
.app-button:focus {
    border-color: var(--accent-strong);
    background: #249abb;
    color: #fff;
}

.btn-primary:active,
.app-button:active {
    transform: translateY(1px);
}

.alert,
.result-field {
    border-radius: 8px;
    padding: 14px 16px;
    color: var(--muted);
    background: rgba(20, 36, 58, 0.72);
    border: 1px solid rgba(56, 191, 216, 0.22);
}

.alert-info {
    color: #dff8ff;
    background: rgba(40, 160, 201, 0.12);
    border-color: rgba(40, 160, 201, 0.42);
}

.alert-warning {
    color: #fff5dc;
    background: rgba(201, 149, 40, 0.12);
    border-color: rgba(201, 149, 40, 0.42);
}

.alert-danger {
    color: #ffe7ea;
    background: rgba(219, 92, 101, 0.14);
    border-color: rgba(219, 92, 101, 0.55);
}

.alert-secondary {
    color: var(--muted);
    background: rgba(14, 27, 44, 0.72);
    border-color: rgba(159, 178, 199, 0.22);
}

.cf-turnstile {
    margin-top: 8px;
}

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

@media (max-width: 900px) {
    body {
        padding: 0;
        background: var(--bg);
        display: block;
    }

    .app-shell {
        width: 100%;
        min-height: 100vh;
        border: 0;
        border-radius: 0;
    }

    .brand-panel {
        min-height: 130px;
        padding: 24px;
    }

    .content-panel {
        padding: 36px 24px 48px;
    }

    .application-grid {
        grid-template-columns: 1fr;
    }

    .application-card {
        min-height: 0;
    }
}

@media (max-width: 560px) {
    h1 {
        font-size: 28px;
    }

    .content-panel {
        padding: 30px 18px 42px;
    }

    .section-panel {
        padding: 18px;
    }
}
