@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --mihr-navy: #101828;
    --mihr-bg: #101828;
    --mihr-surface: #1a2332;
    --mihr-border: rgba(255, 255, 255, 0.08);
    --mihr-text: #f1f5f9;
    --mihr-text-muted: #94a3b8;
    --mihr-gold: #a77c37;
    --mihr-gold-light: #b99b4e;
    --mihr-accent: #a77c37;
    --mihr-accent-hover: #b99b4e;
    --mihr-copper: #b99b4e;
    --mihr-on-accent: #101828;
}

* {
    box-sizing: border-box;
}

body.mihr-public {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: var(--mihr-bg);
    color: var(--mihr-text);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.mihr-public::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(167, 124, 55, 0.1), transparent),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(167, 124, 55, 0.05), transparent);
    pointer-events: none;
    z-index: 0;
}

.mihr-public-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    position: relative;
    z-index: 1;
}

.mihr-public-card {
    max-width: 520px;
    width: 100%;
    text-align: center;
    background: var(--mihr-surface);
    border: 1px solid var(--mihr-border);
    border-radius: 16px;
    padding: 48px 40px;
}

.mihr-public-logo {
    max-width: 220px;
    height: auto;
    margin: 0 auto 28px;
    display: block;
}

.mihr-demo-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(185, 155, 78, 0.15);
    border: 1px solid rgba(185, 155, 78, 0.35);
    color: var(--mihr-copper);
    margin-bottom: 24px;
}

.mihr-public-title {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0 0 12px;
    line-height: 1.4;
}

.mihr-public-desc {
    color: var(--mihr-text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 36px;
}

.mihr-public-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mihr-public-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.mihr-public-btn-primary {
    background: var(--mihr-accent);
    color: var(--mihr-on-accent);
}

.mihr-public-btn-primary:hover {
    background: var(--mihr-accent-hover);
    color: var(--mihr-on-accent);
}

.mihr-public-btn-secondary {
    background: transparent;
    border: 1px solid var(--mihr-border);
    color: var(--mihr-text);
}

.mihr-public-btn-secondary:hover {
    border-color: var(--mihr-accent);
    color: var(--mihr-accent);
}

.mihr-public-footer {
    text-align: center;
    padding: 20px;
    font-size: 0.8rem;
    color: var(--mihr-text-muted);
    position: relative;
    z-index: 1;
}

.mihr-public-footer a {
    color: var(--mihr-accent);
    text-decoration: none;
}

.mihr-public-footer a:hover {
    text-decoration: underline;
}

.mihr-coming-soon {
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
}

.mihr-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
    color: var(--mihr-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.mihr-back-link:hover {
    color: var(--mihr-accent);
}

/* Declaration form */
.mihr-declaration-page .mihr-public-main {
    align-items: flex-start;
}

.mihr-declaration-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 32px;
    border-bottom: 1px solid var(--mihr-border);
    background: rgba(16, 24, 40, 0.92);
    position: sticky;
    top: 0;
    z-index: 10;
}

.mihr-declaration-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.mihr-declaration-logo {
    max-width: 70px;
    height: auto;
    display: block;
}

.mihr-declaration-main {
    flex: 1;
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 32px 24px 48px;
    position: relative;
    z-index: 1;
}

.mihr-declaration-shell {
    background: var(--mihr-surface);
    border: 1px solid var(--mihr-border);
    border-radius: 16px;
    overflow: hidden;
}

.mihr-declaration-header {
    padding: 32px 32px 24px;
    border-bottom: 1px solid var(--mihr-border);
    background: linear-gradient(180deg, rgba(167, 124, 55, 0.1), transparent);
}

.mihr-declaration-kicker {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--mihr-accent);
    letter-spacing: 0.02em;
}

.mihr-declaration-title {
    margin: 0 0 8px;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.3;
}

.mihr-declaration-date {
    margin: 0 0 12px;
    color: var(--mihr-text-muted);
    font-size: 0.95rem;
}

.mihr-declaration-note {
    margin: 0;
    font-size: 0.85rem;
    color: var(--mihr-text-muted);
}

.mihr-declaration-note-sep {
    margin: 0 8px;
    opacity: 0.5;
}

.mihr-required-mark {
    color: #f87171;
    font-weight: 700;
}

.mihr-declaration-section-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    border-bottom: 1px solid var(--mihr-border);
}

.mihr-section-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-right: 1px solid var(--mihr-border);
    background: rgba(255, 255, 255, 0.02);
}

.mihr-section-tab:last-child {
    border-right: none;
}

.mihr-section-tab-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    background: var(--mihr-accent-soft);
    color: var(--mihr-accent);
    flex-shrink: 0;
}

.mihr-section-tab-label {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
}

.mihr-section-tab.is-active {
    background: rgba(167, 124, 55, 0.12);
    box-shadow: inset 0 -3px 0 var(--mihr-accent);
}

.mihr-section-tab.is-disabled {
    opacity: 0.45;
}

.mihr-declaration-form {
    padding: 0;
}

.mihr-form-section {
    padding: 28px 32px 32px;
    border-bottom: 1px solid var(--mihr-border);
}

.mihr-form-section:last-child {
    border-bottom: none;
}

.mihr-form-section.is-placeholder {
    background: rgba(255, 255, 255, 0.02);
}

.mihr-form-section-header {
    margin-bottom: 24px;
}

.mihr-form-section-title {
    margin: 0 0 8px;
    font-size: 1.2rem;
    font-weight: 700;
}

.mihr-form-section-desc {
    margin: 0;
    color: var(--mihr-text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.mihr-form-subsection + .mihr-form-subsection {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--mihr-border);
}

.mihr-form-subsection-title {
    margin: 0 0 16px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--mihr-text);
}

.mihr-form-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--mihr-border);
    border-radius: 10px;
    overflow: hidden;
}

.mihr-form-table th,
.mihr-form-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--mihr-border);
    vertical-align: top;
    text-align: left;
}

.mihr-form-table tr:last-child th,
.mihr-form-table tr:last-child td {
    border-bottom: none;
}

.mihr-form-table th {
    width: 38%;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.45;
}

.mihr-form-table td {
    background: rgba(0, 0, 0, 0.12);
}

.mihr-field-hint {
    display: block;
    margin-top: 4px;
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--mihr-text-muted);
}

.mihr-form-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--mihr-text);
    margin-bottom: 8px;
}

.mihr-form-field {
    display: block;
    margin-bottom: 18px;
}

.mihr-form-field-full {
    grid-column: 1 / -1;
}

.mihr-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 20px;
}

.mihr-form-control {
    width: 100%;
    padding: 12px 14px;
    background: var(--mihr-bg);
    border: 1px solid var(--mihr-border);
    border-radius: 8px;
    color: var(--mihr-text);
    font-size: 0.95rem;
    font-family: inherit;
}

.mihr-form-control:focus {
    outline: none;
    border-color: var(--mihr-accent);
    box-shadow: 0 0 0 3px var(--mihr-accent-soft);
}

.mihr-form-control:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

input.mihr-form-control:read-only,
textarea.mihr-form-control:read-only {
    opacity: 0.55;
    cursor: not-allowed;
}

.mihr-form-control:read-only:focus {
    border-color: var(--mihr-border);
    box-shadow: none;
}

.mihr-form-control.is-invalid {
    border-color: #f87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15);
}

.mihr-form-textarea {
    resize: vertical;
    min-height: 96px;
}

.mihr-field-error {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: #f87171;
}

.mihr-field-error.is-hidden {
    display: none;
}

.mihr-searchable-select-row {
    display: grid;
    grid-template-columns: minmax(180px, 34%) minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
}

.mihr-searchable-select-list {
    min-height: 148px;
    cursor: pointer;
}

.mihr-searchable-select-list:disabled {
    cursor: not-allowed;
}

.mihr-searchable-select-list option {
    cursor: pointer;
}

.mihr-declaration-form select.mihr-form-control:not(:disabled) {
    cursor: pointer;
}

.mihr-declaration-form select.mihr-form-control option {
    cursor: pointer;
}

.mihr-searchable-select-hint {
    margin: 8px 0 0;
    font-size: 0.8rem;
    color: var(--mihr-text-muted);
}

.mihr-selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    min-height: 0;
}

.mihr-selected-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--mihr-accent-soft);
    border: 1px solid rgba(167, 124, 55, 0.35);
    color: var(--mihr-accent);
    font-size: 0.82rem;
    font-weight: 500;
}

.mihr-selected-tag button {
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    font-size: 0.95rem;
}

.mihr-section-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 36px 20px;
    border: 1px dashed var(--mihr-border);
    border-radius: 12px;
    color: var(--mihr-text-muted);
    text-align: center;
}

.mihr-section-placeholder i {
    font-size: 1.4rem;
    opacity: 0.7;
}

.mihr-section-placeholder p {
    margin: 0;
    max-width: 420px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.mihr-business-domain-blocks {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.mihr-business-domain-block {
    padding: 24px;
    border: 1px solid var(--mihr-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.mihr-business-domain-block-header,
.mihr-business-process-block-header,
.mihr-ai-function-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.mihr-business-domain-block-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--mihr-text);
}

.mihr-business-process-blocks {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--mihr-border);
}

.mihr-business-process-block {
    padding: 20px;
    border: 1px solid rgba(167, 124, 55, 0.25);
    border-radius: 12px;
    background: rgba(167, 124, 55, 0.06);
}

.mihr-business-process-block-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--mihr-accent);
}

.mihr-business-process-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 0 20px;
    margin-bottom: 20px;
}

.mihr-ai-function-rows {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 14px;
    padding: 16px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.14);
}

.mihr-ai-function-row {
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
}

.mihr-ai-function-row-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--mihr-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mihr-ai-function-row-grid {
    display: grid;
    grid-template-columns: 25% 40% 30%;
    gap: 0 20px;
}

.mihr-ai-function-row-grid > .mihr-form-field:first-child {
    grid-column: 1 / 3;
}

.mihr-ai-function-row-grid > .mihr-form-field:first-child .mihr-searchable-select-row {
    grid-template-columns: 25fr 45fr;
}

.mihr-btn-add-process {
    margin-top: 16px;
}

.mihr-btn-secondary,
.mihr-btn-text-danger {
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.mihr-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid var(--mihr-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--mihr-text);
    font-size: 0.88rem;
    font-weight: 600;
}

.mihr-btn-secondary:hover {
    border-color: var(--mihr-accent);
    background: rgba(167, 124, 55, 0.1);
    color: var(--mihr-accent);
}

.mihr-form-field-narrow {
    max-width: 280px;
}

.mihr-btn-add-row {
    margin-top: 4px;
}

.mihr-btn-add-domain {
    margin-top: 20px;
}

.mihr-btn-text-danger {
    border: none;
    background: transparent;
    color: #f87171;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 4px 0;
}

.mihr-btn-text-danger:hover:not(:disabled) {
    color: #fca5a5;
}

.mihr-btn-text-danger:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.mihr-declarant-statement {
    padding: 20px 22px;
    border: 1px solid var(--mihr-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
}

.mihr-declarant-statement-intro {
    margin: 0 0 14px;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--mihr-text);
}

.mihr-declarant-statement-list {
    margin: 0;
    padding-left: 1.35rem;
    color: var(--mihr-text);
    font-size: 0.92rem;
    line-height: 1.6;
}

.mihr-declarant-statement-list li + li {
    margin-top: 10px;
}

.mihr-signature-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 20px;
}

.mihr-submit-feedback {
    margin-top: 20px;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 0.92rem;
    line-height: 1.5;
}

.mihr-submit-feedback.is-hidden {
    display: none;
}

.mihr-submit-feedback.is-success {
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.35);
    color: #6ee7b7;
}

.mihr-submit-feedback.is-error {
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: #fca5a5;
}

.mihr-form-actions {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--mihr-border);
    display: flex;
    justify-content: flex-end;
}

.mihr-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border: 1px solid var(--mihr-accent);
    border-radius: 8px;
    background: var(--mihr-accent);
    color: var(--mihr-on-accent);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.mihr-btn-primary:hover {
    background: var(--mihr-accent-hover);
    border-color: var(--mihr-accent-hover);
}

.mihr-btn-primary:active {
    transform: translateY(1px);
}

@media (max-width: 768px) {
    .mihr-declaration-topbar {
        padding: 8px 20px;
    }

    .mihr-declaration-header,
    .mihr-form-section {
        padding-left: 20px;
        padding-right: 20px;
    }

    .mihr-declaration-section-nav {
        grid-template-columns: 1fr;
    }

    .mihr-section-tab {
        border-right: none;
        border-bottom: 1px solid var(--mihr-border);
    }

    .mihr-section-tab:last-child {
        border-bottom: none;
    }

    .mihr-form-table,
    .mihr-form-table tbody,
    .mihr-form-table tr,
    .mihr-form-table th,
    .mihr-form-table td {
        display: block;
        width: 100%;
    }

    .mihr-form-table th {
        border-bottom: none;
        padding-bottom: 8px;
    }

    .mihr-form-grid {
        grid-template-columns: 1fr;
    }

    .mihr-searchable-select-row {
        grid-template-columns: 1fr;
    }

    .mihr-ai-function-row-grid,
    .mihr-business-process-fields {
        grid-template-columns: 1fr;
    }

    .mihr-form-field-narrow {
        max-width: none;
    }

    .mihr-signature-fields {
        grid-template-columns: 1fr;
    }

    .mihr-form-actions {
        justify-content: stretch;
    }

    .mihr-btn-primary {
        width: 100%;
    }
}

body.mihr-login-page .mihr-public-main {
    align-items: center;
}

.mihr-login-card {
    max-width: 420px;
    text-align: left;
}

.mihr-login-title {
    font-size: 1.5rem;
    margin-bottom: 8px;
    text-align: center;
}

.mihr-login-desc {
    margin-bottom: 24px;
    text-align: center;
}

.mihr-login-form {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mihr-login-submit {
    width: 100%;
    margin-top: 12px;
    justify-content: center;
}

.mihr-form-alert {
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.875rem;
    margin: 8px 0;
}

.mihr-form-alert-error {
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: #fecaca;
}

.mihr-form-alert-success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #bbf7d0;
}

.mihr-login-footer-note {
    margin: 20px 0 0;
    text-align: center;
    font-size: 0.875rem;
}

.mihr-login-link {
    color: var(--mihr-copper);
    text-decoration: none;
}

.mihr-login-link:hover {
    color: var(--mihr-gold-light);
    text-decoration: underline;
}

.mihr-declaration-draft-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px;
    margin: 0 0 20px;
    padding: 18px 20px;
    border-radius: 12px;
    border: 1px solid rgba(167, 124, 55, 0.45);
    background: linear-gradient(135deg, rgba(167, 124, 55, 0.16), rgba(255, 255, 255, 0.04));
}

.mihr-declaration-draft-banner.is-hidden {
    display: none;
}

.mihr-declaration-draft-banner-icon {
    font-size: 1.75rem;
    color: var(--mihr-copper);
    line-height: 1;
}

.mihr-declaration-draft-banner-title {
    margin: 0 0 4px;
    font-weight: 700;
    color: var(--mihr-text);
}

.mihr-declaration-draft-banner-meta,
.mihr-declaration-draft-banner-text {
    margin: 0;
    color: var(--mihr-text-muted);
    font-size: 0.875rem;
    line-height: 1.5;
}

.mihr-declaration-draft-banner-body {
    flex: 1 1 240px;
}

.mihr-declaration-draft-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.mihr-draft-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1080;
    padding: 12px 16px;
    border-radius: 8px;
    background: var(--mihr-surface);
    border: 1px solid var(--mihr-accent);
    color: var(--mihr-text);
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.mihr-draft-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}
