﻿/* ============================================
   Trademark Registration Page
   Clean, standard UI — no abstract design
   ============================================ */

/* ---- Page wrapper ---- */



.trademark-page {
    min-height: 100vh;
    background: #f5f7fa;
    display: flex;
    flex-direction: column;
    padding-top: 90px;
    position: relative;
    background-image: url("../images/geometricPattern.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Hero: centered glass card matching inheritance page */
.trademark-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: clamp(260px, 38vh, 440px);
    padding: 2.5rem 1rem 2rem;
    background: transparent;
}

.trademark-hero .container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.trademark-hero .section-header {
    flex: 0 1 auto;
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 30px 20px;
    border-radius: 40px;
    text-align: center;
}

.trademark-hero .section-title {
    font-size: 42px;
    color: var(--light-blue);
    margin-bottom: 10px;
    font-weight: 700;
}

.trademark-hero .section-subtitle {
    margin-top: 20px;
    font-size: 18px;
    color: var(--dark-gray);
    font-style: italic;
    line-height: 1.6;
    max-width: 780px;
    margin-left: auto;
    margin-right: auto;
}



/* ---- Main content area ---- */
.tre-content {
    flex: 1;
    padding: 10px 20px 40px;
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
}

/* ---- Page title row ---- */
.tre-page-title {
    margin-bottom: 20px;
}

.tre-page-title h1,
.tre-page-title h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a3a5f;
    margin: 0 0 3px;
}

.tre-page-title p {
    font-size: 0.87rem;
    color: #6b8aa5;
    margin: 0;
}

/* ---- Stepper ---- */
.tre-stepper {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 24px;
    background: #ffffff;
    border: 1px solid #e1e8ef;
    border-radius: 10px;
    padding: 0;
    overflow: hidden;
}

.tre-step-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-right: 1px solid #e1e8ef;
    color: #8ea6bf;
    font-size: 0.82rem;
    font-weight: 600;
    position: relative;
    cursor: default;
}

.tre-step-item:last-child {
    border-right: none;
}

.tre-step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e8eef5;
    color: #7a9ab5;
    font-size: 0.76rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tre-step-text {
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tre-step-item.active {
    background: #f0f6ff;
    color: #1a3a5f;
    border-bottom: 3px solid #1a3a5f;
}

.tre-step-item.active .tre-step-num {
    background: #1a3a5f;
    color: #ffffff;
}

.tre-step-item.done {
    color: #2e7d52;
}

.tre-step-item.done .tre-step-num {
    background: #e6f4ee;
    color: #2e7d52;
}

/* ---- Alert ---- */
.tre-alert {
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 0.84rem;
    font-weight: 600;
    display: none;
}

.tre-alert.info {
    display: block;
    background: #edf5ff;
    color: #1a4a78;
    border: 1px solid #bad4ef;
}

.tre-alert.success {
    display: block;
    background: #edf9f2;
    color: #1d6b44;
    border: 1px solid #b2dfc8;
}

.tre-alert.error {
    display: block;
    background: #fef2f2;
    color: #8b2b2b;
    border: 1px solid #f0c0c0;
}

/* ---- Form card ---- */
.tre-form-card {
    background: #ffffff;
    border: 1px solid #e1e8ef;
    border-radius: 10px;
    padding: 24px;
}

/* ---- Steps visibility ---- */
.tre-step {
    display: none;
}

.tre-step.active {
    display: block;
}

/* ---- Initial button state (JS controls visibility) ---- */
#tre-prev,
#tre-validate,
#tre-submit {
    display: none;
}

/* ---- Form elements ---- */
.trademark-page .form-group {
    margin-bottom: 14px;
}

#tre-form label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #2a4a65;
    margin-bottom: 5px;
}

#tre-form input,
#tre-form select,
#tre-form textarea {
    width: 100%;
    border: 1px solid #cdd9e5;
    border-radius: 7px;
    background: #ffffff;
    color: #1c3650;
    padding: 9px 12px;
    font-size: 0.87rem;
    line-height: 1.4;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

#tre-form textarea {
    min-height: 72px;
    resize: vertical;
}

#tre-form input:focus,
#tre-form select:focus,
#tre-form textarea:focus {
    border-color: #5b8fc7;
    box-shadow: 0 0 0 3px rgba(91, 143, 199, 0.15);
}

#tre-form input::placeholder,
#tre-form textarea::placeholder {
    color: #9ab1c6;
}

/* ---- Grid layouts ---- */
.trademark-page .form-grid {
    display: grid;
    gap: 12px;
}

.trademark-page .form-grid.two-col {
    grid-template-columns: repeat(2, 1fr);
}

/* ---- Toggle checkboxes (mark attributes) ---- */
.trademark-page .toggle-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.trademark-page .toggle-grid label,
.trademark-page .supporting-box label,
.trademark-page .attestations label {
    margin: 0;
    padding: 9px 11px;
    border: 1px solid #d5e2ee;
    border-radius: 7px;
    background: #f9fbfe;
    color: #2a4a65;
    font-size: 0.79rem;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
}

.trademark-page .toggle-grid label:hover,
.trademark-page .supporting-box label:hover,
.trademark-page .attestations label:hover {
    background: #f0f6ff;
    border-color: #b5ccdf;
}

.trademark-page .toggle-grid input,
.trademark-page .supporting-box input,
.trademark-page .attestations input,
.trademark-page .term-item input {
    width: auto !important;
    margin-top: 1px;
    flex-shrink: 0;
    box-shadow: none !important;
}

/* ---- Standalone checkbox row (has_foreign_filing / claim_priority) ---- */
.trademark-page .tre-check-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.trademark-page .tre-check-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border: 1px solid #d5e2ee;
    border-radius: 7px;
    background: #f9fbfe;
    color: #2a4a65;
    font-size: 0.79rem;
    font-weight: 500;
    cursor: pointer;
    margin: 0;
    transition: background 0.12s, border-color 0.12s;
}

.trademark-page .tre-check-label:hover {
    background: #f0f6ff;
    border-color: #b5ccdf;
}

.trademark-page .tre-check-label input[type="checkbox"] {
    width: auto !important;
    margin: 0;
    flex-shrink: 0;
    box-shadow: none !important;
}

/* ---- 2-col permission checkbox grid ---- */
.trademark-page .perm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.trademark-page .perm-item {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.trademark-page .perm-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    border: 1px solid #d5e2ee;
    border-radius: 7px;
    background: #f9fbfe;
    color: #2a4a65;
    font-size: 0.79rem;
    font-weight: 500;
    cursor: pointer;
    margin: 0;
    transition: background 0.12s, border-color 0.12s;
}

.trademark-page .perm-toggle:hover {
    background: #f0f6ff;
    border-color: #b5ccdf;
}

.trademark-page .perm-toggle input[type="checkbox"] {
    width: auto !important;
    margin: 0;
    flex-shrink: 0;
    box-shadow: none !important;
}

/* ---- Permission prompt (compact, below toggle) ---- */
.trademark-page .permission-prompt {
    margin-top: 4px;
    padding: 8px 10px;
    background: #fffbec;
    border: 1px solid #e8c040;
    border-radius: 0 0 7px 7px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.trademark-page .permission-prompt.is-hidden {
    display: none;
}

.trademark-page .perm-label {
    font-size: 0.73rem;
    font-weight: 600;
    color: #7a5200;
    line-height: 1.3;
}

.trademark-page .perm-opts {
    display: flex;
    gap: 6px;
}

.trademark-page .perm-opt {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #2a4a65;
    padding: 4px 10px;
    border: 1px solid #d5e2ee;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    margin: 0;
    transition: background 0.12s, border-color 0.12s;
}

.trademark-page .perm-opt:hover {
    background: #f0f6ff;
    border-color: #9ab8cf;
}

.trademark-page .perm-opt input[type="radio"] {
    width: auto !important;
    margin: 0;
    flex-shrink: 0;
    box-shadow: none !important;
}

/* ---- Upload box ---- */
.trademark-page .upload-box {
    border: 1px dashed #b5cce0;
    border-radius: 8px;
    background: #f8fbfe;
    padding: 14px;
    margin-top: 8px;
}

.trademark-page .upload-box label {
    margin-bottom: 7px;
}

.trademark-page .upload-box small {
    display: block;
    margin-top: 7px;
    color: #6e8fa8;
    font-size: 0.77rem;
}

/* ---- Class picker ---- */
.trademark-page .class-header {
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid #dce8f2;
    border-left: 4px solid #2f6ea8;
    border-radius: 10px;
    background: #f7fbff;
}

.trademark-page .class-header h3 {
    font-size: 1.02rem;
    font-weight: 700;
    color: #17446d;
    margin: 0 0 4px;
}

.trademark-page .class-header p {
    font-size: 0.82rem;
    color: #557c9b;
    margin: 0;
}

.class-picker {
    display: grid;
    gap: 10px;
    margin-bottom: 10px;
}

.trademark-page .class-empty {
    border: 1px dashed #ccd8e5;
    border-radius: 8px;
    background: #fafcff;
    color: #6b8aa5;
    padding: 12px;
    font-size: 0.82rem;
}

.trademark-page .class-row {
    border: 1px solid #d8e4ef;
    border-radius: 10px;
    background: #ffffff;
    padding: 12px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: start;
}

.trademark-page .class-row.is-selected {
    border-color: #1a3a5f;
    box-shadow: 0 0 0 1px rgba(26, 58, 95, 0.08);
    background: #f9fcff;
}

.trademark-page .class-row-main {
    min-width: 0;
}

.trademark-page .class-row-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.trademark-page .class-row-num {
    min-width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #edf4fb;
    color: #20507c;
    font-size: 0.76rem;
    font-weight: 700;
}

.trademark-page .class-row-title-text {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a3a5f;
}

.trademark-page .class-row-desc {
    font-size: 0.8rem;
    line-height: 1.45;
    color: #496783;
    height: auto;
}

.trademark-page .class-row-fee {
    margin-top: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #1e5a3a;
}

.trademark-page .class-row-actions {
    display: grid;
    gap: 8px;
    min-width: 132px;
}

.trademark-page .class-row-select {
    border: 1px solid #ccd8e5;
    border-radius: 7px;
    padding: 8px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    background: #ffffff;
    color: #1f466b;
}

.trademark-page .class-row-select:hover {
    border-color: #9bbbd6;
    background: #f4f9ff;
}

.trademark-page .class-row-count {
    text-align: center;
    background: #e8f0fb;
    color: #1a4070;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
}

.trademark-page .class-selection-summary {
    font-size: 0.81rem;
    color: #4f7595;
    margin-bottom: 10px;
}

.trademark-page .class-card {
    border: 1px solid #dce8f2;
    border-radius: 9px;
    padding: 12px;
    margin-bottom: 10px;
    background: #ffffff;
}

.trademark-page .class-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.trademark-page .class-card h4 {
    font-size: 0.88rem;
    font-weight: 700;
    color: #1a3a5f;
    margin: 0;
}

.trademark-page .class-term-count {
    background: #e8f0fb;
    color: #1a4070;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
}

.class-meta {
    font-size: 0.75rem;
    color: #6b8aa5;
    margin-bottom: 8px;
}

.trademark-page .term-search {
    margin-bottom: 7px;
}

.trademark-page .term-list {
    display: grid;
    gap: 6px;
}

.trademark-page .term-item {
    border: 1px solid #dce8f2;
    border-radius: 7px;
    padding: 7px 9px;
    background: #f9fbfe;
}

.trademark-page .term-item label {
    margin: 0;
    display: grid;
    grid-template-columns: 18px 72px 1fr;
    align-items: center;
    gap: 7px;
    cursor: pointer;
}

.trademark-page .term-item .code {
    font-size: 0.73rem;
    color: #4a7090;
    font-weight: 700;
}

.trademark-page .term-item .txt {
    font-size: 0.75rem;
    color: #243e58;
    line-height: 1.4;
}

/* ---- Attestations / review / result ---- */
.trademark-page .attestations,
.trademark-page .supporting-box {
    border: 1px solid #dce8f2;
    border-radius: 9px;
    padding: 14px;
    background: #f9fbfe;
    margin-bottom: 12px;
    display: grid;
    gap: 9px;
}

.trademark-page .attestations h4,
.trademark-page .supporting-box h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a3a5f;
    margin: 0 0 4px;
}

.trademark-page .review-card,
.trademark-page .result-card {
    border: 1px solid #dce8f2;
    border-radius: 9px;
    padding: 14px;
    background: #f9fbfe;
    margin-bottom: 10px;
    color: #1c3650;
}

.trademark-page .review-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.trademark-page .review-grid div {
    background: #ffffff;
    border: 1px solid #e1ebf4;
    border-radius: 7px;
    padding: 8px 10px;
    font-size: 0.8rem;
}

.trademark-page .review-classes-wrap {
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
}

.trademark-page .review-class-item {
    background: #ffffff;
    border: 1px solid #e1ebf4;
    border-radius: 8px;
    padding: 10px;
}

.trademark-page .review-class-head {
    font-size: 0.84rem;
    font-weight: 700;
    color: #1a3a5f;
    margin-bottom: 6px;
}

.trademark-page .review-class-head span {
    color: #5b7893;
    font-weight: 600;
}

.trademark-page .review-goods-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 4px;
}

.trademark-page .review-goods-list li {
    font-size: 0.77rem;
    color: #2b4863;
    line-height: 1.35;
}

.trademark-page .review-goods-list .code {
    font-weight: 700;
    color: #2f5f89;
}

.trademark-page .review-estimate {
    background: #f2f8ff;
    border: 1px solid #cfe2f6;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.83rem;
    color: #18466f;
}

.trademark-page .review-estimate-note {
    margin-top: 5px;
    font-size: 0.77rem;
    color: #527493;
}

.trademark-page .invoice-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.trademark-page .invoice-grid div {
    background: #ffffff;
    border: 1px solid #dce8f2;
    border-radius: 7px;
    padding: 8px 10px;
    font-size: 0.79rem;
    color: #1c3650;
}

/* ---- Actions bar ---- */
.tre-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #edf2f7;
}

/* ---- Buttons (scoped to trademark page only) ---- */
.trademark-page .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    min-width: 120px;
    border: 1.5px solid transparent;
    letter-spacing: 0.01em;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.trademark-page .btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.trademark-page .btn-prev {
    background: #ffffff;
    color: #2a4a65;
    border-color: #c8d8e8;
    box-shadow: 0 1px 3px rgba(42, 74, 101, 0.08);
}

.trademark-page .btn-prev:hover:not(:disabled) {
    background: #f0f6fb;
    border-color: #9ab8cf;
    box-shadow: 0 2px 6px rgba(42, 74, 101, 0.12);
}

.trademark-page .btn-next,
.trademark-page .btn-submit,
#tre-next,
#upload-image-btn,
#tre-validate,
#tre-submit {
    background: #1a3a5f;
    color: #ffffff;
    border-color: #1a3a5f;
    box-shadow: 0 2px 6px rgba(26, 58, 95, 0.22);
}

.trademark-page .btn-next:hover:not(:disabled),
.trademark-page .btn-submit:hover:not(:disabled),
#tre-next:hover:not(:disabled),
#upload-image-btn:hover:not(:disabled),
#tre-validate:hover:not(:disabled),
#tre-submit:hover:not(:disabled) {
    background: #234e80;
    border-color: #234e80;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(26, 58, 95, 0.28);
}

/* ---- Conditional fields ---- */
.tre-conditional.is-hidden {
    display: none;
}

/* ============================================
   Field validation states
   ============================================ */

/* Required indicator on label */
.trademark-page .form-group.is-required > label {
    display: flex;
    align-items: baseline;
    gap: 3px;
}

.trademark-page .form-group.is-required > label .req {
    color: #c0392b;
    font-weight: 700;
    font-size: 1em;
    line-height: 1;
}

/* Error state — label, input/select/textarea */
.trademark-page .form-group.field-error > label {
    color: #c0392b;
}

.trademark-page .form-group.field-error input,
.trademark-page .form-group.field-error select,
.trademark-page .form-group.field-error textarea {
    border-color: #e74c3c !important;
    background-color: #fff8f8;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.10);
    outline: none;
}

.trademark-page .upload-box.field-error {
    border-color: #e74c3c;
    background: #fff8f8;
}

.trademark-page .upload-box.field-error > label {
    color: #c0392b;
}

/* Valid state */
.trademark-page .form-group.field-valid input,
.trademark-page .form-group.field-valid select,
.trademark-page .form-group.field-valid textarea {
    border-color: #27ae60 !important;
    box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.08);
}

.trademark-page .upload-box.field-valid {
    border-color: #27ae60;
}

/* Inline error hint below field */
.trademark-page .field-hint {
    display: block;
    font-size: 0.76rem;
    color: #c0392b;
    margin-top: 5px;
    font-weight: 500;
    line-height: 1.3;
}

/* Class picker error */
.trademark-page #class-picker.field-error {
    border: 1.5px solid #e74c3c;
    border-radius: 8px;
    padding: 8px;
    background-color: #fff8f8;
}

/* Attestation / supporting label error */
.trademark-page .attestations label.field-error,
.trademark-page .supporting-box label.field-error {
    border-color: #e74c3c;
    background: #fff8f8;
    color: #c0392b;
}

/* Permission prompt error (no answer chosen) */
.trademark-page .permission-prompt.perm-error {
    border-color: #e74c3c;
    background: #fff2f2;
}

.trademark-page .permission-prompt.perm-error .perm-label {
    color: #c0392b;
}

/* ============================================
   Class Modal (Goods/Terms Selection)
   ============================================ */

.tre-class-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    animation: treModalFadeIn 0.22s ease-out;
}

.tre-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 15% 20%, rgba(36, 116, 173, 0.24), transparent 38%),
        radial-gradient(circle at 85% 80%, rgba(9, 42, 79, 0.22), transparent 40%),
        rgba(4, 12, 24, 0.64);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tre-modal-box {
    background: linear-gradient(160deg, #ffffff 0%, #f7fbff 100%);
    border: 1px solid #d6e6f5;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(7, 24, 45, 0.32);
    max-width: 620px;
    width: min(620px, 100%);
    max-height: min(85vh, 760px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(0);
    animation: treModalSlideIn 0.24s ease-out;
}

.tre-summary-modal .tre-modal-box {
    max-width: 760px;
    width: min(760px, 100%);
}

.tre-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid #dbe9f5;
    background: linear-gradient(140deg, #f8fbff 0%, #eef6fd 100%);
}

.tre-modal-header h3 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 700;
    color: #0f3558;
    letter-spacing: 0.2px;
}

.tre-modal-close {
    background: #ffffff;
    border: 1px solid #d0e2f2;
    font-size: 1.45rem;
    cursor: pointer;
    color: #497094;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    transition: all 0.2s ease, transform 0.2s ease;
}

.tre-modal-close:hover {
    background: #eaf4fc;
    border-color: #b7d7f0;
    color: #164f80;
    transform: rotate(90deg);
}

.tre-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 22px;
    background: #ffffff;
}

.modal-terms-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tre-class-picker-modal .class-modal-intro {
    margin: 0 0 10px;
    border: 1px solid #d8e9f8;
    background: #f3f9ff;
    color: #1b4f78;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.83rem;
    line-height: 1.45;
}

.tre-class-picker-modal .class-modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.tre-class-picker-modal .class-modal-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    color: #365f7d;
    border: 1px solid #d5e6f4;
    background: #f7fbff;
    border-radius: 999px;
    padding: 5px 9px;
}

.tre-class-picker-modal .class-modal-chip i {
    color: #2a6a9d;
}

.modal-term-item {
    display: flex;
    align-items: flex-start;
}

.modal-term-item label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #e3edf6;
    background: #fcfdff;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.modal-term-item label:hover {
    background: #f4f9ff;
    border-color: #c9dff3;
    transform: translateY(-1px);
}

.modal-term-item input[type="checkbox"] {
    flex-shrink: 0;
    width: 19px;
    height: 19px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #0f70bc;
}

.modal-term-item .code {
    font-weight: 700;
    color: #305978;
    font-size: 0.85rem;
    min-width: 58px;
}

.modal-term-item .txt {
    color: #163e62;
    font-size: 0.92rem;
    flex: 1;
    line-height: 1.42;
}

.tre-modal-footer {
    display: flex;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid #dbe9f5;
    background: linear-gradient(180deg, #f8fbff 0%, #f1f7fd 100%);
}

.tre-modal-cancel,
.tre-modal-confirm {
    flex: 1;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-weight: 700;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: all 0.2s ease, transform 0.2s ease;
}

.tre-modal-cancel {
    background: #e8f0f8;
    border-color: #d0dfec;
    color: #335877;
}

.tre-modal-cancel:hover {
    background: #dce9f5;
    border-color: #bdd5e8;
    transform: translateY(-1px);
}

.tre-modal-confirm {
    background: linear-gradient(135deg, #0b6fb8 0%, #08508f 100%);
    color: #ffffff;
    border-color: #0a5f9f;
    box-shadow: 0 10px 20px rgba(11, 79, 136, 0.25);
}

.tre-modal-confirm:hover {
    background: linear-gradient(135deg, #0b7bc9 0%, #0a5f9f 100%);
    transform: translateY(-1px);
}

.tre-summary-modal .summary-intro {
    margin: 0 0 10px;
    border: 1px solid #d8e9f8;
    background: #f3f9ff;
    color: #1b4f78;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.84rem;
    line-height: 1.45;
}

.tre-summary-modal .summary-total-line {
    font-size: 0.9rem;
    font-weight: 700;
    color: #123f66;
    margin-bottom: 12px;
}

.tre-summary-modal .summary-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.tre-summary-modal .summary-metric-card {
    border: 1px solid #d8e8f6;
    background: linear-gradient(170deg, #ffffff 0%, #f4f9ff 100%);
    border-radius: 12px;
    padding: 10px;
    display: grid;
    gap: 3px;
}

.tre-summary-modal .metric-icon {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #e7f3ff;
    color: #0f5b96;
    font-size: 0.84rem;
}

.tre-summary-modal .metric-label {
    font-size: 0.74rem;
    color: #58758f;
    font-weight: 600;
}

.tre-summary-modal .metric-value {
    font-size: 0.9rem;
    color: #123f66;
    line-height: 1.3;
}

.tre-summary-modal .summary-note-line {
    font-size: 0.82rem;
    color: #4f708b;
    margin-bottom: 12px;
    line-height: 1.45;
}

.tre-summary-modal .summary-classes-wrap {
    display: grid;
    gap: 11px;
}

.tre-summary-modal .summary-class-block {
    border: 1px solid #d7e7f5;
    border-radius: 12px;
    padding: 12px;
    background: linear-gradient(170deg, #ffffff 0%, #f8fcff 100%);
    box-shadow: 0 6px 14px rgba(16, 60, 98, 0.06);
}

.tre-summary-modal .summary-class-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.tre-summary-modal .summary-class-block h4 {
    margin: 0;
    font-size: 0.88rem;
    color: #113b5f;
    font-weight: 700;
}

.tre-summary-modal .summary-class-block h4 i {
    color: #2b6c9f;
}

.tre-summary-modal .summary-class-meta {
    font-size: 0.72rem;
    color: #406784;
    border: 1px solid #d6e7f5;
    background: #f0f7ff;
    border-radius: 999px;
    padding: 4px 8px;
    white-space: nowrap;
}

.tre-summary-modal .summary-goods-list {
    margin: 0;
    padding-left: 0;
    list-style: none;
    display: grid;
    gap: 5px;
}

.tre-summary-modal .summary-goods-list li {
    font-size: 0.81rem;
    color: #244762;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 7px;
}

.tre-summary-modal .summary-goods-list .term-bullet {
    color: #1f7c4d;
    line-height: 1.4;
    margin-top: 1px;
}

.tre-summary-modal .summary-goods-list .code {
    font-weight: 700;
    color: #315f86;
}

.tre-submit-note-modal .submit-note-prompt {
    margin: 0 0 10px;
    color: #2f4d67;
    font-size: 0.9rem;
}

.tre-submit-note-modal .submit-note-input {
    width: 100%;
    border: 1px solid #cddce9;
    border-radius: 8px;
    padding: 12px;
    font-size: 0.9rem;
    color: #1a3a5f;
    resize: vertical;
    min-height: 120px;
}

.tre-submit-result-modal .submit-result-shell {
    border: 1px solid #d9e8f6;
    border-radius: 14px;
    overflow: hidden;
    background: #fbfdff;
}

.tre-submit-result-modal .submit-result-status {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid #dbe9f6;
    background: linear-gradient(180deg, #f7fbff 0%, #f0f7ff 100%);
}

.tre-submit-result-modal .submit-result-icon {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.02rem;
    flex: 0 0 auto;
}

.tre-submit-result-modal .submit-result-status-copy h4 {
    margin: 0 0 4px;
    font-size: 0.97rem;
    line-height: 1.35;
}

.tre-submit-result-modal .submit-result-status-copy p {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #4c6b85;
}

.tre-submit-result-modal .submit-result-shell.success .submit-result-icon {
    background: #eaf7ee;
    color: #1f7c4d;
}

.tre-submit-result-modal .submit-result-shell.error .submit-result-icon {
    background: #fff0f0;
    color: #b24141;
}

.tre-submit-result-modal .submit-result-message {
    border-radius: 10px;
    margin: 12px;
    padding: 12px 14px;
    line-height: 1.65;
    font-size: 0.9rem;
}

.tre-submit-result-modal .submit-result-message p {
    margin: 0 0 8px;
}

.tre-submit-result-modal .submit-result-message p:last-child {
    margin-bottom: 0;
}

.tre-submit-result-modal .submit-result-message.success {
    background: #eef8f2;
    border: 1px solid #bde5cb;
    color: #226341;
}

.tre-submit-result-modal .submit-result-message.error {
    background: #fff2f2;
    border: 1px solid #efc0c0;
    color: #8a2e2e;
}

.tre-submit-result-modal .submit-result-message a {
    color: #0d4f8b;
    word-break: break-all;
    text-decoration: underline;
}

@keyframes treModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes treModalSlideIn {
    from {
        transform: translateY(12px) scale(0.985);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 900px) {
    .trademark-hero {
        min-height: 220px;
        padding: 2rem 0.75rem 1.5rem;
    }

    .trademark-hero .section-header {
        padding: 20px 15px;
        border-radius: 28px;
    }

    .trademark-hero .section-title {
        font-size: 32px;
    }

    .trademark-hero .section-subtitle {
        font-size: 15px;
        margin-top: 15px;
    }

    .tre-content {
        padding: 20px 14px 32px;
    }

    .tre-modal-overlay {
        padding: 12px;
    }

    .tre-modal-box,
    .tre-summary-modal .tre-modal-box {
        width: 100%;
        max-width: 100%;
        max-height: 90vh;
        border-radius: 14px;
    }

    .tre-modal-header,
    .tre-modal-body,
    .tre-modal-footer {
        padding-left: 14px;
        padding-right: 14px;
    }

    .tre-modal-footer {
        flex-direction: column-reverse;
    }

    .tre-summary-modal .summary-metrics {
        grid-template-columns: 1fr;
    }

    .tre-class-picker-modal .class-modal-meta {
        gap: 6px;
    }

    .tre-summary-modal .summary-class-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .tre-modal-cancel,
    .tre-modal-confirm {
        width: 100%;
    }

    .tre-stepper {
        flex-wrap: wrap;
    }

    .tre-step-item {
        flex: 0 0 50%;
        border-bottom: 1px solid #e1e8ef;
    }

    .tre-step-item:nth-child(even) {
        border-right: none;
    }

    .trademark-page .class-row {
        grid-template-columns: 1fr;
    }

    .trademark-page .class-row-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        min-width: 0;
    }
}

@media (max-width: 640px) {
    .trademark-hero .section-header {
        padding: 15px 10px;
        border-radius: 24px;
    }

    .trademark-hero .section-title {
        font-size: 28px;
    }

    .trademark-hero .section-subtitle {
        font-size: 14px;
    }

    .tre-content {
        padding: 14px 10px 28px;
    }

    .tre-stepper {
        display: none;
    }

    .tre-stepper-mobile {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 16px;
        font-size: 0.84rem;
        font-weight: 600;
        color: #1a3a5f;
    }

    .tre-stepper-mobile-num {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: #1a3a5f;
        color: #ffffff;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 0.78rem;
        font-weight: 700;
        flex-shrink: 0;
    }

    .form-grid.two-col,
    .toggle-grid,
    .perm-grid,
    .invoice-grid {
        grid-template-columns: 1fr;
    }

    .trademark-page .review-grid {
        grid-template-columns: 1fr;
    }

    .trademark-page .class-row-actions {
        grid-template-columns: 1fr;
    }

    .tre-form-card {
        padding: 16px;
    }

    .tre-actions {
        flex-direction: column-reverse;
    }

    .tre-actions .btn {
        width: 100%;
        min-width: unset;
    }
}

/* ============================================
   RTL support
   ============================================ */

html[dir="rtl"] .trademark-page {
    direction: rtl;
}

html[dir="rtl"] .tre-step-item {
    border-right: none;
    border-left: 1px solid #e1e8ef;
}

html[dir="rtl"] .tre-step-item:last-child {
    border-left: none;
}

html[dir="rtl"] .tre-step-item.active {
    border-bottom: 3px solid #1a3a5f;
    border-left-color: #e1e8ef;
}

html[dir="rtl"] .tre-actions {
    justify-content: flex-start;
    flex-direction: row-reverse;
}

html[dir="rtl"] .trademark-page .term-item label {
    grid-template-columns: 1fr 72px 18px;
}

html[dir="rtl"] .trademark-page .term-item .txt,
html[dir="rtl"] .trademark-page .term-item .code,
html[dir="rtl"] #tre-form label,
html[dir="rtl"] .trademark-page .class-selection-summary,
html[dir="rtl"] .trademark-page .class-meta {
    text-align: right;
}

@media (max-width: 900px) {
    [dir="rtl"] .tre-step-item:nth-child(even) {
        border-left: none;
        border-right: 1px solid #e1e8ef;
    }
}
