@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

:root {
    --text: #18313f;
    --muted: #637887;
    --line: rgba(31, 57, 69, 0.14);
    --surface: rgba(255, 255, 255, 0.88);
    --surface-strong: rgba(255, 255, 255, 0.96);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
    font-family: "Yu Gothic UI", "Meiryo", "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
}

body {
    background: #e7f6f3;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

.portal-shell {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    background: linear-gradient(135deg, #effbf7 0%, #e7f5ff 46%, #ffffff 100%);
}

.portal-shell::before,
.portal-shell::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
}

    .portal-shell::before {
        z-index: -2;
        background: url('/images/portal-background.png') center / cover no-repeat;
        opacity: 0.4;
        filter: saturate(1.15) contrast(1.1);
    }

.portal-shell::after {
    z-index: -1;
    background:
        radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.92), transparent 30%),
        linear-gradient(135deg, rgba(238, 250, 246, 0.9), rgba(232, 244, 255, 0.86) 52%, rgba(255, 255, 255, 0.76));
}

.portal-page {
    min-height: 100vh;
    padding: 28px;
}

.hero,
.workspace {
    width: min(1180px, 100%);
    margin: 0 auto;
}

.hero {
    min-height: 330px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 26px clamp(22px, 4vw, 44px);
}

.hero-topbar,
.hero-content,
.summary-grid,
.toolbar,
.app-card-header,
.app-card-footer,
.profile-panel,
.task-strip {
    display: flex;
    align-items: center;
}

.hero-topbar,
.hero-content,
.summary-grid,
.toolbar {
    gap: 18px;
}

.hero-topbar {
    justify-content: space-between;
}

.brand,
.session-pill,
.profile-panel,
.summary-grid,
.toolbar,
.task-strip,
.empty-state {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 18px 48px rgba(32, 78, 96, 0.12);
    backdrop-filter: blur(14px);
}

.brand,
.session-pill {
    min-height: 42px;
    border-radius: 999px;
    padding: 8px 14px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.brand-mark {
    display: inline-grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 8px;
    background: #0f8f83;
    color: #fff;
    font-size: 0.78rem;
}

.session-pill {
    color: #11624f;
}

.session-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.logout-button {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #44606d;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(32, 78, 96, 0.1);
}

.session-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #1fb97f;
    box-shadow: 0 0 0 6px rgba(31, 185, 127, 0.16);
}

.hero-content {
    justify-content: space-between;
    align-items: flex-end;
    padding: 34px 0 20px;
}

.hero-copy {
    max-width: 690px;
}

.eyebrow,
.category {
    margin: 0 0 8px;
    color: #10766b;
    font-weight: 800;
    letter-spacing: 0;
}

h1 {
    margin: 0;
    font-size: clamp(2.05rem, 4vw, 3.8rem);
    line-height: 1.08;
    letter-spacing: 0;
}

h1:focus {
    outline: none;
}

.lead {
    max-width: 620px;
    margin: 14px 0 0;
    color: #365464;
    font-size: 1.08rem;
    line-height: 1.75;
}

.profile-panel {
    gap: 14px;
    min-width: 280px;
    padding: 16px;
    border-radius: 8px;
}

.avatar {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    border-radius: 50%;
    background: #dff5ef;
    color: #0b806f;
    font-weight: 800;
    font-size: 1.35rem;
}

.profile-name,
.profile-mail {
    margin: 0;
}

.profile-name {
    font-weight: 800;
}

.profile-mail {
    color: var(--muted);
    font-size: 0.92rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-radius: 8px;
    padding: 12px 16px;
}

.summary-grid > div {
    min-width: 0;
    padding: 8px 18px;
    border-left: 1px solid var(--line);
}

.summary-grid > div:first-child {
    border-left: 0;
}

.summary-number,
.summary-label {
    display: block;
}

.summary-number {
    font-size: 1.7rem;
    font-weight: 850;
}

.summary-label {
    color: var(--muted);
}

.workspace {
    padding-bottom: 32px;
}

.toolbar {
    justify-content: space-between;
    align-items: stretch;
    margin-bottom: 12px;
    border-radius: 8px;
    padding: 14px;
}

.search-box {
    min-width: min(360px, 100%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.search-box input {
    width: 100%;
    min-height: 44px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.category-tab {
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 14px;
    background: #fff;
    color: #45606d;
    cursor: pointer;
}

.category-tab.active {
    border-color: #109b88;
    background: #e1f8f2;
    color: #0c665b;
    font-weight: 800;
}

.task-strip {
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
    border-radius: 8px;
    padding: 12px;
}

.task-strip span {
    border-radius: 8px;
    padding: 8px 10px;
    background: #fff8e6;
    color: #7d5a0d;
    font-weight: 700;
    font-size: 0.92rem;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.app-card {
    min-height: 236px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid var(--line);
    border-top: 5px solid var(--accent);
    border-radius: 8px;
    padding: 18px;
    background: var(--surface-strong);
    box-shadow: 0 18px 44px rgba(40, 81, 99, 0.12);
}

.app-card.is-primary {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(232, 250, 246, 0.96));
}

.app-card.is-locked {
    opacity: 0.72;
}

.app-card-header,
.app-card-footer {
    justify-content: space-between;
    gap: 12px;
}

.app-icon {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 8px;
    background: color-mix(in srgb, var(--accent) 14%, white);
    color: var(--accent);
    font-size: 1rem;
}

.status {
    border-radius: 999px;
    padding: 6px 10px;
    background: #f4f8fa;
    color: #54707d;
    font-size: 0.84rem;
    font-weight: 700;
}

.app-card-body {
    padding: 18px 0;
}

.app-card h2 {
    margin: 0 0 8px;
    font-size: 1.24rem;
    letter-spacing: 0;
}

.app-card p {
    line-height: 1.6;
}

.app-card-body > p:last-child {
    min-height: 52px;
    margin: 0;
    color: #4c6571;
}

.open-link,
.request-link {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 8px;
    padding: 0 14px;
    border: 1px solid transparent;
    text-decoration: none;
    font-weight: 800;
}

.open-link {
    background: var(--accent);
    color: #fff;
}

.request-link {
    background: #fff;
    color: #5f7380;
    border-color: var(--line);
    cursor: pointer;
}

.open-link-disabled,
.open-link-disabled:disabled {
    background: #d8e2e7;
    color: #70838c;
    cursor: not-allowed;
    opacity: 0.78;
}

.app-loading {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(234, 246, 251, 0.97), rgba(210, 234, 243, 0.97));
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.app-loading--hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.app-loading__panel {
    display: grid;
    justify-items: center;
    gap: 18px;
    padding: 32px 44px;
}

.app-loading__spinner {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 5px solid rgba(22, 184, 181, 0.22);
    border-top-color: #0b8f83;
    animation: app-loading-spin 0.9s linear infinite;
}

.app-loading__text {
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--ink);
}

@keyframes app-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-loading {
        transition: none;
    }

    .app-loading__spinner {
        animation-duration: 2.4s;
    }
}

.incident-menu-page {
    min-height: 100vh;
    padding: 48px;
    background:
        linear-gradient(120deg, rgba(237, 250, 255, 0.88), rgba(255, 255, 255, 0.72)),
        url("../images/portal-background.png") center / cover fixed;
    color: var(--ink);
}

.incident-menu-hero,
.incident-menu-grid {
    width: min(980px, 100%);
}

.incident-menu-hero {
    margin-bottom: 22px;
    border: 1px solid rgba(178, 224, 235, 0.86);
    border-radius: 8px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 18px 44px rgba(40, 81, 99, 0.14);
}

.incident-back-link {
    display: inline-flex;
    margin-bottom: 18px;
    color: #0b8f83;
    font-weight: 800;
    text-decoration: none;
}

.incident-menu-hero h1 {
    margin: 0 0 10px;
    font-size: 2.1rem;
    letter-spacing: 0;
}

.incident-menu-hero p:last-child {
    margin: 0;
    color: #4c6571;
    line-height: 1.7;
}

.incident-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.incident-menu-card {
    display: grid;
    grid-template-columns: 50px 1fr auto;
    align-items: center;
    gap: 16px;
    min-height: 112px;
    border: 1px solid rgba(178, 224, 235, 0.86);
    border-left: 5px solid #e76f51;
    border-radius: 8px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--ink);
    text-decoration: none;
    box-shadow: 0 18px 44px rgba(40, 81, 99, 0.12);
}

.incident-menu-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 50px rgba(40, 81, 99, 0.16);
}

.incident-menu-icon {
    display: inline-grid;
    width: 50px;
    height: 50px;
    place-items: center;
    border-radius: 8px;
    background: #fff2ed;
    color: #e76f51;
}

.incident-menu-card strong,
.incident-menu-card small {
    display: block;
}

.incident-menu-card strong {
    margin-bottom: 6px;
    font-size: 1.1rem;
}

.incident-menu-card small {
    color: #5f7380;
    line-height: 1.5;
}

.incident-menu-arrow {
    color: #0b8f83;
}

.redirect-error-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
    background: #eef6fb;
}

.redirect-error-panel {
    width: min(680px, 100%);
    border: 1px solid rgba(37, 99, 135, 0.18);
    border-radius: 8px;
    padding: 28px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 40px rgba(20, 66, 96, 0.12);
}

.redirect-error-panel h1 {
    margin: 0 0 12px;
    color: var(--text);
    font-size: 1.35rem;
}

.redirect-error-panel p {
    color: var(--muted);
}

.redirect-error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 18px;
}

.primary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border: 0;
    border-radius: 7px;
    padding: 0 14px;
    background: #0b8f83;
    color: #ffffff;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.primary-button {
    min-height: 40px;
}

.secondary-link {
    background: #ffffff;
    color: #0b8f83;
    border: 1px solid rgba(11, 143, 131, 0.28);
}

.empty-state {
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
    border-radius: 8px;
    padding: 24px;
    color: var(--muted);
}

#blazor-error-ui {
    background: #fff4ce;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #b32121;
    color: white;
    padding: 1rem;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        linear-gradient(135deg, rgba(238, 250, 246, 0.66), rgba(232, 244, 255, 0.6)),
        url('/images/portal-background.png') center / cover no-repeat;
}

.login-card {
    width: min(480px, 100%);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 28px 80px rgba(33, 85, 107, 0.18);
    backdrop-filter: blur(16px);
}

.login-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    font-weight: 800;
}

.login-copy h1 {
    font-size: clamp(1.7rem, 4vw, 2.35rem);
    line-height: 1.18;
}

.login-copy p:last-child {
    margin: 12px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.login-form {
    display: grid;
    gap: 10px;
    margin-top: 26px;
}

.login-form label {
    font-weight: 800;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 14px;
    outline: none;
}

.login-form input:focus {
    border-color: #109b88;
    box-shadow: 0 0 0 4px rgba(16, 155, 136, 0.12);
}

.remember-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 8px;
    color: #45606d;
    font-weight: 700 !important;
}

.login-button {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 8px;
    background: #0f8f83;
    color: #fff;
    font-weight: 850;
    cursor: pointer;
}

.login-error,
.field-error {
    color: #b42318;
    font-weight: 700;
}

.login-error ul {
    margin: 0 0 8px;
    padding-left: 1.2rem;
}

@media (max-width: 900px) {
    .portal-page {
        padding: 18px;
    }

    .hero-content {
        align-items: flex-start;
        flex-direction: column;
        padding-top: 34px;
    }

    .toolbar {
        flex-direction: column;
    }

    .category-tabs {
        justify-content: flex-start;
    }

    .app-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .incident-menu-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .portal-page {
        padding: 12px;
    }

    .hero {
        min-height: auto;
        padding: 18px;
    }

    .hero-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .profile-panel {
        width: 100%;
        min-width: 0;
    }

    .summary-grid,
    .app-grid {
        grid-template-columns: 1fr;
    }

    .summary-grid > div {
        border-left: 0;
        border-top: 1px solid var(--line);
    }

    .summary-grid > div:first-child {
        border-top: 0;
    }

    .incident-menu-page {
        padding: 18px;
    }

    .incident-menu-hero {
        padding: 22px;
    }

    .incident-menu-card {
        grid-template-columns: 44px 1fr;
    }

    .incident-menu-arrow {
        display: none;
    }
}
