/* ─── Full-page layout ─── */
.hci-page {
    background: #f5f5f6;
    min-height: 100vh;
    padding: clamp(16px, 3vw, 40px);
}

/* ─── Split layout: form left, viewer right ─── */
.hci-split {
    display: grid;
    gap: 0;
    grid-template-columns: 380px 1fr;
    margin: 0 auto;
    max-width: 1400px;
    min-height: calc(100vh - 80px);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(16, 24, 40, 0.08);
}

.hci-panel {
    display: flex;
    flex-direction: column;
}

/* ─── Left panel: form ─── */
.hci-panel--form {
    background: #ffffff;
    border-right: 1px solid #e4e7ec;
    padding: 32px 28px;
}

.hci-panel-head {
    margin-bottom: 28px;
}

.hci-title {
    color: #111827;
    font-size: clamp(20px, 2.5vw, 26px);
    font-weight: 800;
    line-height: 1.25;
    margin: 0 0 6px;
}

.hci-subtitle {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

/* Form */
.hci-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hci-field label {
    color: #374151;
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 5px;
}

.hci-required {
    color: #ef4444;
}

.hci-field input {
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #111827;
    font-size: 14px;
    min-height: 44px;
    padding: 10px 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

.hci-field input:focus {
    background: #ffffff;
    border-color: #1363df;
    box-shadow: 0 0 0 3px rgba(19, 99, 223, 0.12);
    outline: none;
}

.hci-field input::placeholder {
    color: #9ca3af;
}

.hci-hint {
    color: #9ca3af;
    display: block;
    font-size: 12px;
    margin-top: 4px;
}

/* Button */
.hci-button {
    align-items: center;
    background: linear-gradient(135deg, #1363df 0%, #0b46a0 100%);
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    font-size: 15px;
    font-weight: 700;
    gap: 8px;
    justify-content: center;
    min-height: 48px;
    padding: 12px 24px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    width: 100%;
}

.hci-button:hover {
    box-shadow: 0 6px 20px rgba(19, 99, 223, 0.35);
    transform: translateY(-1px);
}

.hci-button:active {
    transform: translateY(0);
}

.hci-button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

.hci-button-loading::before {
    animation: hci-spin 0.8s linear infinite;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    content: "";
    display: inline-block;
    height: 16px;
    width: 16px;
}

@keyframes hci-spin {
    to { transform: rotate(360deg); }
}

/* Message area under form */
.hci-msg {
    margin-top: 16px;
}

.hci-msg-success {
    align-items: center;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    color: #065f46;
    display: flex;
    font-size: 13px;
    font-weight: 600;
    gap: 8px;
    padding: 10px 14px;
}

.hci-msg-error {
    align-items: center;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    display: flex;
    font-size: 13px;
    font-weight: 600;
    gap: 8px;
    padding: 10px 14px;
}

/* ─── Right panel: PDF viewer ─── */
.hci-panel--viewer {
    background: #1a1a2e;
    position: relative;
}

.hci-viewer-empty {
    align-items: center;
    color: #6b7280;
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
    height: 100%;
    min-height: 500px;
    padding: 40px;
    text-align: center;
}

.hci-viewer-empty-icon {
    font-size: 48px;
    opacity: 0.5;
}

.hci-viewer-empty p {
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
    max-width: 320px;
}

.hci-viewer-frame {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 500px;
}

.hci-viewer-bar {
    align-items: center;
    background: #16213e;
    border-bottom: 1px solid #2a2a4a;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 10px 16px;
}

.hci-viewer-title {
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hci-viewer-actions {
    display: flex;
    gap: 8px;
}

.hci-viewer-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #e2e8f0 !important;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    text-decoration: none !important;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.hci-viewer-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff !important;
}

.hci-viewer-iframe {
    border: 0;
    flex: 1;
    min-height: 460px;
    width: 100%;
}

/* ─── Notices ─── */
.hci-notice {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    color: #92400e;
    font-size: 14px;
    font-weight: 600;
    padding: 14px 18px;
    text-align: center;
}

/* ─── Responsive ─── */
@media (max-width: 860px) {
    .hci-split {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .hci-panel--form {
        border-right: 0;
        border-bottom: 1px solid #e4e7ec;
    }

    .hci-viewer-empty {
        min-height: 300px;
    }

    .hci-viewer-frame {
        min-height: 400px;
    }

    .hci-viewer-iframe {
        min-height: 360px;
    }
}

@media (max-width: 480px) {
    .hci-page {
        padding: 12px;
    }

    .hci-panel--form {
        padding: 20px 16px;
    }

    .hci-viewer-bar {
        flex-direction: column;
        gap: 8px;
    }
}
