:root {
    --hurtz-blue: #00308d;
    --hurtz-blue-dark: #002766;
    --hurtz-red: #d94a4a;
    --surface: #ffffff;
    --page-bg: #f4f6f8;
    --metal: #e7ebf0;
    --border: #d8dee6;
    --text: #2f343a;
    --muted: #666666;
    --focus: rgba(0, 48, 141, 0.22);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
    color: var(--text);
    background: var(--page-bg);
    font-family: "Source Sans Pro", "Segoe UI", Arial, sans-serif;
}

a,
.btn-link {
    color: var(--hurtz-blue);
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

input {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.7rem 0.85rem;
    color: var(--text);
    background: var(--surface);
}

input:focus,
button:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 1px;
    border-color: var(--hurtz-blue);
}

h1 {
    margin: 0;
    color: var(--text);
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0;
}

p {
    color: var(--muted);
}

h1:focus {
    outline: none;
}

.app-shell,
.app-main {
    min-height: 100vh;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 82px;
    padding: 0 8vw;
    background: var(--hurtz-blue);
    color: #ffffff;
    border-bottom: 4px solid var(--metal);
}

.brand-lockup,
.login-topbar,
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-logo,
.login-logo {
    width: 120px;
    height: 82px;
    object-fit: contain;
    background: #ffffff;
}

.login-logo {
    width: 104px;
    height: auto;
    transform: none;
}

.brand-title {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 700;
}

.brand-subtitle {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.95rem;
}

.login-page {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
    background:
        radial-gradient(circle at 18% 24%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 28rem),
        linear-gradient(135deg, rgba(0, 48, 141, 0.1), rgba(255, 255, 255, 0.2) 42%, rgba(0, 48, 141, 0.08)),
        var(--page-bg);
}

.login-page::before {
    position: absolute;
    inset: 0;
    content: "";
    background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.32) 0 1px, transparent 1px 18px),
        repeating-linear-gradient(0deg, rgba(0, 48, 141, 0.035) 0 1px, transparent 1px 22px);
    mask-image: linear-gradient(110deg, transparent 0%, #000 12%, #000 70%, transparent 100%);
    pointer-events: none;
}

.login-page::after {
    position: absolute;
    right: -10rem;
    bottom: -8rem;
    width: min(64vw, 760px);
    aspect-ratio: 1.55;
    content: "";
    border: 32px solid rgba(0, 48, 141, 0.08);
    border-radius: 8px;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.78),
        inset 0 0 46px rgba(255, 255, 255, 0.55),
        0 24px 70px rgba(28, 39, 54, 0.12);
    transform: rotate(-8deg);
    pointer-events: none;
}

.login-frame-visual {
    position: absolute;
    left: max(2rem, 7vw);
    top: 50%;
    width: min(34vw, 460px);
    aspect-ratio: 1.62;
    transform: translateY(-50%) rotate(-4deg);
    opacity: 0.82;
    pointer-events: none;
}

.login-frame-visual::before,
.login-frame-visual::after,
.login-frame-visual span {
    position: absolute;
    content: "";
    border-radius: 4px;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.82), rgba(194, 202, 212, 0.58) 42%, rgba(255, 255, 255, 0.72)),
        #d7dde5;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 -1px 0 rgba(91, 104, 121, 0.18),
        0 16px 36px rgba(28, 39, 54, 0.1);
}

.login-frame-visual::before,
.login-frame-visual::after {
    left: 0;
    right: 0;
    height: 34px;
}

.login-frame-visual::before {
    top: 0;
}

.login-frame-visual::after {
    bottom: 0;
}

.login-frame-visual span {
    top: 0;
    bottom: 0;
    width: 34px;
}

.login-frame-visual span:nth-child(1) {
    left: 0;
}

.login-frame-visual span:nth-child(2) {
    right: 0;
}

.login-frame-visual span:nth-child(3) {
    left: 32%;
    top: 34px;
    bottom: 34px;
    width: 18px;
    opacity: 0.72;
}

.login-frame-visual span:nth-child(4) {
    right: 28%;
    top: 34px;
    bottom: 34px;
    width: 18px;
    opacity: 0.58;
}

.login-shell {
    position: relative;
    z-index: 1;
    width: min(100%, 440px);
}

.login-brand-panel {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.85rem;
    border: 1px solid rgba(216, 222, 230, 0.86);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 18px 45px rgba(28, 39, 54, 0.1);
    backdrop-filter: blur(8px);
}

.login-logo-plate {
    display: grid;
    place-items: center;
    width: 138px;
    min-height: 78px;
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background:
        linear-gradient(180deg, #ffffff 0%, #ffffff 68%, #eef2f7 100%);
    box-shadow:
        inset 0 1px 0 #ffffff,
        0 10px 24px rgba(28, 39, 54, 0.08);
}

.login-brand-copy {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.login-brand-copy strong {
    color: var(--hurtz-blue);
    font-size: 1.05rem;
    line-height: 1.15;
}

.login-brand-copy span {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.25;
}

.login-topbar {
    justify-content: space-between;
    margin-bottom: 1rem;
}

.login-panel,
.workspace-panel,
.result-panel {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 18px 45px rgba(28, 39, 54, 0.08);
}

.login-panel {
    display: grid;
    gap: 1.25rem;
    padding: 1.5rem;
}

.login-panel p {
    margin: 0.35rem 0 0;
}

.primary-action,
.icon-text-button {
    min-height: 44px;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0.7rem 1rem;
    font-weight: 700;
}

.primary-action {
    color: #ffffff;
    background: var(--hurtz-blue);
}

.primary-action:hover {
    background: var(--hurtz-blue-dark);
}

.icon-text-button.secondary {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

.document-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--hurtz-blue);
    background: #ffffff;
    border-color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
    white-space: nowrap;
}

.document-link:hover {
    color: var(--hurtz-blue-dark);
    background: #eef2f7;
}

.calculator-page {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 2rem 0;
}

.calculator-intro {
    margin-bottom: 1rem;
}

.calculator-intro p {
    margin: 0;
}

.calculator-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.8fr);
    gap: 1rem;
    align-items: start;
}

.workspace-panel,
.result-panel {
    padding: 1.5rem;
}

.workspace-panel {
    display: grid;
    gap: 1.25rem;
}

.field-group {
    display: grid;
    gap: 0.45rem;
}

.field-group label {
    color: var(--text);
    font-weight: 700;
}

.dimension-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.unit-input {
    position: relative;
}

.unit-input input {
    padding-right: 3.2rem;
}

.unit-input span {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-weight: 700;
}

.combo-edit {
    position: relative;
    display: grid;
}

.combo-edit input {
    padding-right: 3rem;
}

.combo-toggle {
    position: absolute;
    right: 4px;
    top: 4px;
    width: 36px;
    height: 36px;
    border: 0;
    border-left: 1px solid var(--border);
    color: var(--hurtz-blue);
    background: #ffffff;
    font-weight: 700;
}

.combo-options {
    position: absolute;
    z-index: 10;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow: auto;
    padding: 0.35rem;
    margin: 0;
    list-style: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 18px 35px rgba(28, 39, 54, 0.14);
}

.combo-options button {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 0;
    border-radius: 4px;
    padding: 0.65rem 0.7rem;
    color: var(--text);
    background: transparent;
    text-align: left;
}

.combo-options button:hover {
    background: #eef2f7;
}

.combo-options small {
    color: var(--muted);
}

.result-panel {
    border-top: 4px solid var(--hurtz-blue);
}

.result-label,
.result-meta span,
.calculation-state {
    color: var(--muted);
    font-weight: 700;
}

.price-value {
    margin: 0.3rem 0 1.2rem;
    color: var(--hurtz-blue);
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.1;
}

.result-meta {
    display: grid;
    gap: 0.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.result-meta strong {
    font-size: 1.2rem;
}

.calculation-state,
.status-note {
    margin-top: 1rem;
    border-radius: 6px;
    padding: 0.75rem 0.85rem;
    background: #eef2f7;
    color: var(--muted);
}

.delivery-conditions {
    margin-top: 1rem;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(28, 39, 54, 0.08);
}

.delivery-conditions h2 {
    margin: 0;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--hurtz-blue);
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0;
    text-align: left;
    text-transform: uppercase;
}

.delivery-conditions h3 {
    width: min(92%, 920px);
    margin: 1.15rem auto 0.35rem;
    color: var(--hurtz-blue);
    font-size: 0.98rem;
    font-weight: 800;
    text-align: left;
}

.delivery-conditions p {
    width: min(92%, 920px);
    margin: 0 auto;
    color: var(--text);
    line-height: 1.48;
}

.delivery-conditions .delivery-lead {
    margin-top: 1.25rem;
    padding: 0.9rem 1rem;
    border-radius: 6px;
    background: #eef2f7;
    color: var(--text);
}

.delivery-conditions .delivery-footer {
    margin-top: 1.35rem;
    margin-bottom: 1.35rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.language-switch {
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.12);
}

.login-topbar .language-switch {
    border-color: var(--border);
    background: #ffffff;
}

.language-switch button {
    min-width: 46px;
    min-height: 36px;
    border: 0;
    color: inherit;
    background: transparent;
    font-weight: 800;
}

.login-topbar .language-switch button {
    color: var(--hurtz-blue);
}

.language-switch button.active {
    color: var(--hurtz-blue);
    background: #ffffff;
}

.login-topbar .language-switch button.active {
    color: #ffffff;
    background: var(--hurtz-blue);
}

.validation-message {
    color: #b32121;
    font-weight: 700;
}

.not-found {
    width: min(720px, calc(100% - 2rem));
    margin: 4rem auto;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0.75rem 1rem;
    color: #ffffff;
    background: #b32121;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
}

@media (max-width: 820px) {
    .app-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 1rem;
    }

    .header-actions {
        width: 100%;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .calculator-grid,
    .dimension-grid {
        grid-template-columns: 1fr;
    }

    .price-value {
        font-size: 1.85rem;
    }

    .login-frame-visual {
        left: 50%;
        top: auto;
        bottom: 4rem;
        width: min(78vw, 420px);
        transform: translateX(-50%) rotate(-4deg);
        opacity: 0.36;
    }
}

@media (max-width: 520px) {
    .login-page {
        padding: 1rem;
    }

    .login-brand-panel {
        grid-template-columns: 1fr auto;
    }

    .login-logo-plate {
        grid-column: 1 / -1;
        width: 100%;
    }

    .brand-lockup {
        align-items: flex-start;
        flex-direction: column;
    }
}
