:root {
    --ink: #202634;
    --muted: #687386;
    --line: #dbe5f0;
    --blue: #12a8dc;
    --blue-dark: #045da8;
    --orange: #0867c9;
    --green: #18a76c;
    --red: #e14b4b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: #edf5fc;
    font-family: "Segoe UI", Arial, sans-serif;
    overflow-x: hidden;
}

.portal {
    width: min(1180px, calc(100% - 28px));
    margin: 0 auto;
    padding: 34px 0;
}

.hero {
    min-height: 260px;
    display: grid;
    align-content: center;
    margin-bottom: 22px;
    padding: 34px;
    background: linear-gradient(135deg, #ffffff 0%, #dff2ff 100%);
    border: 1px solid var(--line);
    border-radius: 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    color: var(--blue-dark);
}

.brand img {
    width: 120px;
    height: 62px;
    object-fit: contain;
    background: #fff;
    border-radius: 10px;
}

.hero h1 {
    max-width: 680px;
    margin: 0 0 10px;
    font-size: clamp(34px, 6vw, 52px);
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.hero p {
    max-width: 560px;
    margin: 0;
    color: var(--muted);
    font-size: 18px;
}

.grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr);
    gap: 20px;
}

.card {
    min-width: 0;
    padding: 24px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(38, 54, 85, .12);
}

h2,
h3,
p {
    margin-top: 0;
}

form {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    max-width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    color: var(--ink);
    outline-color: var(--blue);
}

.two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.upload-group {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px dashed #9acfea;
    border-radius: 14px;
}

.file-picker {
    width: max-content;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 12px;
    color: var(--blue-dark);
    background: #eef8ff;
    border: 1px solid #b9def6;
    border-radius: 12px;
    cursor: pointer;
}

.file-picker input {
    display: none;
}

.queued-files {
    display: grid;
    gap: 8px;
}

.queued-files p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.queued-file {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.queued-file img,
.queued-file > i {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    object-fit: cover;
    color: var(--blue-dark);
    background: #eaf7ff;
    border-radius: 10px;
}

.queued-file b,
.queued-file small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queued-file small {
    color: var(--muted);
    font-size: 12px;
}

.queued-file button {
    min-height: 36px;
    padding: 0 10px;
    color: var(--red);
    background: #fff;
    border: 1px solid #f0c0c0;
    border-radius: 10px;
    font-weight: 800;
    cursor: pointer;
}

.primary,
.secondary {
    min-height: 46px;
    padding: 0 14px;
    border: 0;
    border-radius: 12px;
    font-weight: 900;
    cursor: pointer;
}

.primary {
    color: #fff;
    background: var(--blue-dark);
}

.secondary {
    color: #fff;
    background: var(--blue-dark);
}

.alert {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 800;
}

.alert.success {
    color: #0d5e3d;
    background: #dff8ed;
}

.alert.error {
    color: #8a2020;
    background: #ffe5e5;
}

.ticket-status {
    margin: 18px 0;
    padding: 16px;
    background: #f7fbff;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow-wrap: anywhere;
}

.code {
    display: inline-flex;
    margin-bottom: 10px;
    padding: 6px 10px;
    color: #fff;
    background: var(--blue-dark);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.status-row,
.files {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.status-row > *,
.files a {
    padding: 8px 10px;
    background: #edf3f9;
    border-radius: 999px;
    color: var(--ink);
    text-decoration: none;
    font-weight: 800;
}

.timeline {
    display: grid;
    gap: 10px;
    margin: 12px 0;
}

.timeline > div {
    padding: 12px;
    border-left: 4px solid var(--blue);
    background: #f8fbfe;
    border-radius: 10px;
}

.timeline .client-msg {
    border-left-color: var(--blue-dark);
}

.timeline small {
    display: block;
    color: var(--muted);
    margin: 4px 0 8px;
}

.reply {
    margin-top: 18px;
}

@media (max-width: 860px) {
    .portal {
        width: min(100% - 20px, 1180px);
        padding: 18px 0 28px;
    }

    .grid,
    .two {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
        margin-bottom: 16px;
        padding: 24px;
        border-radius: 14px;
    }

    .brand {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .brand img {
        width: 150px;
        max-width: 100%;
    }

    .hero p {
        font-size: 16px;
    }

    .card {
        padding: 18px;
        border-radius: 14px;
    }

    .primary,
    .secondary {
        width: 100%;
    }

    .status-row > *,
    .files a {
        max-width: 100%;
        overflow-wrap: anywhere;
        border-radius: 12px;
    }

    .file-picker {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 420px) {
    .portal {
        width: min(100% - 16px, 1180px);
        padding-top: 12px;
    }

    .hero {
        padding: 18px;
    }

    .hero h1 {
        font-size: 31px;
    }

    .card {
        padding: 15px;
    }

    input,
    select,
    textarea {
        padding: 11px 12px;
    }

    .queued-file {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .queued-file button {
        grid-column: 1 / -1;
    }
}
