:root {
    --bg: #f5fbff;
    --paper: #ffffff;
    --ink: #102033;
    --muted: #526276;
    --accent: #ef3e36;
    --accent-strong: #c91f2f;
    --accent-soft: #ffe8e5;
    --brand-blue: #0b5fff;
    --brand-green: #65c900;
    --brand-yellow: #ffbf2f;
    --surface-blue: #eaf4ff;
    --surface-green: #effbe7;
    --line: rgba(16, 32, 51, 0.12);
    --shadow: 0 18px 38px rgba(11, 95, 255, 0.12);
    --radius-lg: 8px;
    --radius-md: 8px;
}

html,
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

a,
.btn-link {
    color: inherit;
}

* {
    box-sizing: border-box;
}

h1,
h2,
h3,
h4,
.navbar-brand {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    letter-spacing: 0;
}

h1:focus {
    outline: none;
}

p {
    line-height: 1.7;
}

.section-kicker {
    margin: 0 0 0.75rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08rem;
    font-size: 0.82rem;
    font-weight: 700;
}

.hero-panel,
.story-card,
.metric-card,
.service-card,
.page-card,
.contact-card,
.contact-form-card,
.timeline-card,
.support-card,
.support-note,
.admin-login-card {
    border-radius: var(--radius-lg);
    background: var(--paper);
    border: 1px solid rgba(16, 32, 51, 0.08);
    box-shadow: var(--shadow);
}

.hero-panel {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 2fr 1fr;
    padding: 2rem;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(234, 244, 255, 0.94) 58%, rgba(239, 251, 231, 0.96) 100%);
    border-top: 5px solid var(--brand-green);
}

.hero-panel h1 {
    margin: 0;
    max-width: 18ch;
    font-size: 2.85rem;
    line-height: 1.12;
    font-weight: 800;
    text-wrap: balance;
}

.hero-copy {
    width: 100%;
    max-width: none;
    margin: 1.25rem 0 0;
    color: var(--muted);
    font-size: 1.08rem;
}

.hero-actions {
    display: flex;
    gap: 0.9rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.hero-actions-top {
    margin-top: 0;
    margin-bottom: 1.25rem;
}

.primary-link,
.secondary-link,
.inline-link,
.submit-button,
.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 999px;
    min-height: 3rem;
    padding: 0.8rem 1.3rem;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 700;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.primary-link,
.submit-button {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #ffffff;
    border: 0;
    box-shadow: 0 12px 26px rgba(239, 62, 54, 0.22);
}

.danger-button {
    background: #fff1ef;
    color: #a63226;
    border: 1px solid rgba(166, 50, 38, 0.18);
}

.secondary-link,
.inline-link {
    background: var(--surface-blue);
    color: var(--ink);
    border: 1px solid rgba(11, 95, 255, 0.14);
}

.primary-link:hover,
.secondary-link:hover,
.inline-link:hover,
.submit-button:hover,
.danger-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(16, 32, 51, 0.12);
}

.highlight-card {
    padding: 1.5rem;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #102033 0%, #0b5fff 58%, #138a36 100%);
    color: #ffffff;
    box-shadow: 0 16px 30px rgba(11, 95, 255, 0.22);
}

.highlight-label {
    margin: 0 0 1rem;
    color: #cfff8e;
    text-transform: uppercase;
    letter-spacing: 0.08rem;
    font-size: 0.75rem;
}

.hero-list {
    margin: 0;
    padding-left: 1.1rem;
    line-height: 1.8;
}

.portfolio-text,
.editable-list-text {
    margin: 0;
    line-height: 1.75;
    white-space: pre-line;
}

.content-grid,
.service-grid,
.page-grid,
.about-grid,
.contact-grid,
.support-grid,
.internal-file-list {
    display: grid;
    gap: 1.5rem;
}

.content-grid,
.page-grid,
.about-grid,
.contact-grid,
.support-grid,
.internal-file-list {
    margin-top: 1.5rem;
}

.story-card,
.page-card,
.contact-card,
.contact-form-card,
.timeline-card,
.support-card,
.support-note,
.admin-login-card {
    padding: 1.7rem;
}

.story-card,
.service-card,
.page-card,
.contact-card,
.contact-form-card,
.timeline-card,
.support-card,
.support-note,
.admin-login-card,
.metric-card {
    position: relative;
    overflow: hidden;
}

.story-card::before,
.service-card::before,
.page-card::before,
.contact-card::before,
.contact-form-card::before,
.timeline-card::before,
.support-card::before,
.support-note::before,
.admin-login-card::before,
.metric-card::before {
    content: "";
    display: block;
    height: 4px;
    margin: -1.7rem -1.7rem 1.35rem;
    background: linear-gradient(90deg, var(--brand-blue), var(--brand-green), var(--brand-yellow), var(--accent));
}

.metric-strip {
    display: grid;
    gap: 1rem;
}

.metric-card {
    padding: 1.5rem;
}

.metric-value {
    display: block;
    font-size: 1.85rem;
    line-height: 1.15;
    font-weight: 800;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--brand-blue);
    overflow-wrap: anywhere;
}

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

.services-preview,
.page-section {
    margin-top: 2rem;
}

.section-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.service-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.service-card {
    padding: 1.5rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.service-card:hover {
    transform: translateY(-3px);
    border-color: rgba(101, 201, 0, 0.34);
    box-shadow: 0 22px 40px rgba(11, 95, 255, 0.16);
}

.service-card h3 {
    margin: 0.3rem 0 0.8rem;
}

.service-category {
    margin: 0;
    color: var(--brand-blue);
    text-transform: uppercase;
    letter-spacing: 0.08rem;
    font-size: 0.76rem;
    font-weight: 700;
}

.page-grid,
.about-grid,
.contact-grid,
.support-grid,
.internal-file-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.contact-submit-button {
    margin-top: 1.25rem;
}

.support-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
}

.internal-file-card {
    justify-content: space-between;
}

.support-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.4rem;
    min-height: 3.4rem;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-green) 100%);
    color: #ffffff;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 800;
    letter-spacing: 0.08rem;
}

.download-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(11, 95, 255, 0.95), rgba(101, 201, 0, 0.82));
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #ffffff;
    text-decoration: none;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 700;
    box-shadow: 0 14px 26px rgba(11, 95, 255, 0.18);
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.download-button:visited,
.download-button:focus,
.download-button:hover {
    color: #ffffff;
    text-decoration: none;
}

.download-button:hover {
    background: linear-gradient(135deg, rgba(11, 95, 255, 0.98), rgba(101, 201, 0, 0.92));
    border-color: rgba(101, 201, 0, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(11, 95, 255, 0.24);
}

.support-note {
    margin-top: 1.5rem;
}

.support-admin-link {
    margin-top: 1rem;
}

.admin-toolbar {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.admin-login-page {
    min-height: calc(100vh - 8rem);
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 1.25rem;
}

.admin-login-intro {
    max-width: 52rem;
    text-align: center;
}

.admin-login-intro .hero-copy {
    margin-left: auto;
    margin-right: auto;
}

.admin-login-shell {
    display: grid;
    width: 100%;
    place-items: center;
}

.admin-login-card {
    width: min(100%, 32rem);
}

.admin-service-list {
    display: grid;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.content-admin-grid {
    display: grid;
    gap: 1.5rem;
    margin-top: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.content-admin-card {
    display: grid;
    gap: 1rem;
}

.cms-page-body {
    margin-top: 1.5rem;
}

.cms-page-body p:first-child {
    margin-top: 0;
}

.admin-service-card {
    display: grid;
    gap: 1.25rem;
}

.admin-service-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
}

.admin-service-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    margin-bottom: 0.35rem;
}

.admin-checkboxes {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.admin-checkboxes label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 600;
}

.status-inline {
    color: #16783a;
    font-weight: 600;
}

.admin-form {
    display: grid;
    gap: 1rem;
}

.admin-error {
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 8px;
    background: #fde8e8;
    color: #9b1c1c;
    font-weight: 600;
}

.admin-logout {
    border: 0;
    cursor: pointer;
}

.timeline {
    margin: 1rem 0 0;
    padding-left: 1.2rem;
}

.timeline li {
    margin-bottom: 0.85rem;
}

.field-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.form-field.full-width {
    grid-column: 1 / -1;
}

.form-field label {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 600;
}

.form-field input,
.form-field textarea,
.form-field select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    padding: 0.9rem 1rem;
    font: inherit;
    color: var(--ink);
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    outline: none;
    border-color: rgba(11, 95, 255, 0.55);
    box-shadow: 0 0 0 4px rgba(11, 95, 255, 0.12);
}

.status-message {
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 8px;
    background: #edf7ef;
    color: #1f5f34;
    font-weight: 600;
}

.validation-message {
    color: #b42318;
    font-size: 0.9rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.blazor-error-boundary {
    background: #8e1c12;
    padding: 1rem;
    color: white;
    border-radius: 8px;
}

.blazor-error-boundary::after {
    content: "A aparut o eroare.";
}

@media (max-width: 900px) {
    .hero-panel,
    .service-grid,
    .page-grid,
    .about-grid,
    .contact-grid,
    .support-grid,
    .content-admin-grid,
    .internal-file-list,
    .field-grid {
        grid-template-columns: 1fr;
    }

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

    .hero-panel {
        padding: 1.5rem;
        gap: 1.25rem;
    }

    .hero-copy {
        max-width: none;
    }

    .highlight-card {
        padding: 1.25rem;
    }

    .service-card,
    .story-card,
    .page-card,
    .contact-card,
    .contact-form-card,
    .timeline-card,
    .support-card,
    .support-note,
    .admin-login-card,
    .metric-card {
        padding: 1.35rem;
    }

    .admin-login-page {
        min-height: auto;
        align-content: start;
    }

    .admin-service-header {
        flex-direction: column;
    }
}

@media (max-width: 640.98px) {
    .section-kicker {
        font-size: 0.74rem;
        letter-spacing: 0.11rem;
    }

    .page-section,
    .services-preview,
    .content-grid,
    .page-grid,
    .about-grid,
    .contact-grid,
    .support-grid,
    .internal-file-list,
    .admin-toolbar,
    .admin-service-list,
    .content-admin-grid {
        margin-top: 1.25rem;
    }

    .hero-panel,
    .story-card,
    .metric-card,
    .service-card,
    .page-card,
    .contact-card,
    .contact-form-card,
    .timeline-card,
    .support-card,
    .support-note,
    .admin-login-card {
        border-radius: 8px;
    }

    .hero-panel,
    .story-card,
    .page-card,
    .contact-card,
    .contact-form-card,
    .timeline-card,
    .support-card,
    .support-note,
    .admin-login-card {
        padding: 1.2rem;
    }

    .hero-panel h1 {
        max-width: none;
        font-size: 2rem;
        line-height: 1.15;
        text-wrap: wrap;
    }

    .hero-copy {
        font-size: 1rem;
        margin-top: 0.9rem;
    }

    .highlight-card {
        border-radius: 8px;
        padding: 1.1rem;
    }

    .highlight-label {
        margin-bottom: 0.7rem;
        letter-spacing: 0.11rem;
    }

    .hero-list {
        padding-left: 1rem;
        line-height: 1.65;
    }

    .hero-actions,
    .hero-actions-top,
    .admin-toolbar,
    .admin-service-actions {
        gap: 0.75rem;
    }

    .hero-actions .primary-link,
    .hero-actions .secondary-link,
    .hero-actions .inline-link,
    .hero-actions .download-button,
    .hero-actions .submit-button,
    .hero-actions .danger-button,
    .hero-actions-top .primary-link,
    .hero-actions-top .secondary-link,
    .hero-actions-top .inline-link,
    .hero-actions-top .download-button,
    .hero-actions-top .submit-button,
    .hero-actions-top .danger-button,
    .admin-toolbar .primary-link,
    .admin-toolbar .secondary-link,
    .admin-toolbar .inline-link,
    .admin-toolbar .download-button,
    .admin-toolbar .submit-button,
    .admin-toolbar .danger-button,
    .admin-service-actions .primary-link,
    .admin-service-actions .secondary-link,
    .admin-service-actions .inline-link,
    .admin-service-actions .download-button,
    .admin-service-actions .submit-button,
    .admin-service-actions .danger-button {
        width: 100%;
    }

    .primary-link,
    .secondary-link,
    .inline-link,
    .submit-button,
    .danger-button,
    .download-button {
        width: 100%;
        min-height: 2.85rem;
        padding: 0.78rem 1rem;
    }

    .metric-card,
    .service-card,
    .story-card,
    .page-card,
    .contact-card,
    .contact-form-card,
    .timeline-card,
    .support-card,
    .support-note,
    .admin-login-card {
        padding: 1.1rem;
    }

    .field-grid {
        gap: 0.85rem;
    }

    .form-field input,
    .form-field textarea,
    .form-field select {
        border-radius: 8px;
        padding: 0.8rem 0.95rem;
    }

    .section-header {
        margin-bottom: 0.75rem;
    }

    .section-header h2,
    .story-card h2,
    .page-card h2,
    .contact-card h2,
    .contact-form-card h2,
    .support-card h2 {
        margin-top: 0;
        font-size: 1.55rem;
        line-height: 1.2;
    }

    .metric-value {
        font-size: 1.65rem;
    }

    .support-badge {
        min-width: 3rem;
        min-height: 3rem;
        border-radius: 8px;
    }

    .admin-checkboxes {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.75rem;
    }

    .internal-file-card {
        gap: 0.9rem;
    }
}
