/* ================================================================
   Registration.aspx — Page-specific styles (English / LTR)
   ================================================================
   These classes are used ONLY in Registration.aspx for the
   sign-up form layout, branding strip, tree wrapper overrides,
   sign-in prompt, and submit-button loading state.
   ================================================================ */

/* ── Layout box ─────────────────────────────────────────────────── */
.reg-layout-box {
    border-radius: 6px;
    padding: 0;
    overflow: hidden;
}

.reg-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 20px 24px 12px;
}

.reg-title-row .s-title {
    margin: 0;
}

/* ── Two-column grid ────────────────────────────────────────────── */
.reg-two-col {
    display: flex;
    flex-wrap: wrap;
}

.reg-col-left,
.reg-col-right {
    padding: 0 15px;
}

@media (max-width: 767px) {
    .reg-col-left,
    .reg-col-right {
        width: 100%;
    }
}

/* ── Panel & section titles ─────────────────────────────────────── */
.reg-panel {
    padding: 16px 8px;
}

.reg-section-title {
    color: #2e8795;
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reg-section-title i {
    font-size: 1rem;
    opacity: 0.7;
}

/* ── Field labels ───────────────────────────────────────────────── */
.reg-field-label {
    display: block;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.reg-field-label small {
    font-weight: 400;
    color: #a0aec0;
    margin-left: 6px;
    font-size: 0.8rem;
}

/* ── Divider ────────────────────────────────────────────────────── */
.reg-divider {
    border: none;
    border-top: 1px dashed #e2e8f0;
    margin: 18px 0;
}

/* ── Brand logos row ────────────────────────────────────────────── */
.reg-brand-logos {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.reg-brand-avatars {
    display: flex;
    align-items: center;
}

.reg-logo-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    object-fit: cover;
    margin-right: -8px;         /* overlap effect — LTR */
}

.reg-logo-circle:last-child {
    margin-right: 0;
}

.reg-tender-wordmark {
    height: 22px;
    opacity: 0.5;
}

/* ── Checkbox label ─────────────────────────────────────────────── */
.reg-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #4a5568;
    cursor: pointer;
}

.reg-checkbox-label span {
    line-height: 1.5;
}

/* ── Submit button — loading state ──────────────────────────────── */
.reg-submit-btn {
    position: relative;
    transition: opacity 0.2s;
}

.reg-submit-btn .btn-label-default {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.reg-submit-btn .btn-label-loading {
    display: none;
    align-items: center;
    gap: 6px;
}

.reg-submit-btn.btn-loading .btn-label-default {
    display: none;
}

.reg-submit-btn.btn-loading .btn-label-loading {
    display: inline-flex;
}

.reg-submit-btn.btn-loading {
    pointer-events: none;
    opacity: 0.7;
}

/* ── Note wrap (brand story) ────────────────────────────────────── */
.reg-note-wrap {
    margin-top: 4px;
}

.brand-story {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 14px 18px;
    font-size: 0.85rem;
    line-height: 1.7;
    color: #718096;
}

/* ── Sign-in prompt ─────────────────────────────────────────────── */
.signin-prompt-wrap {
    margin-top: 8px;
}

.signin-prompt {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 10px 16px;
}

.signin-prompt-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #2e8795;
    color: #fff;
    padding: 6px 14px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.2s;
    white-space: nowrap;
}

.signin-prompt-btn:hover {
    background: #24707c;
    color: #fff;
    text-decoration: none;
}

.signin-prompt-text {
    font-size: 0.85rem;
    color: #92400e;
}

/* ── Right column: tree wrapper overrides ────────────────────────── */
.reg-tree-wrapper {
    padding: 0;
}

/* Override the usercategories.css grid so the tree takes full width */
.reg-tree-wrapper .category-selection-container .main-content {
    grid-template-columns: 1fr;
    padding: 0;
    box-shadow: none;
    min-height: 0;
}

.reg-tree-section {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 640px;
}

.reg-tree-header {
    padding: 14px 16px 10px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.reg-tree-head-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.reg-tree-head-top h5 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #2e8795;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reg-tree-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ff7f27;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 50%;
    transition: background 0.2s;
}

.reg-tree-count-badge.empty {
    background: #cbd5e1;
}

.reg-tree-head-actions {
    display: flex;
    gap: 6px;
}

.reg-tree-head-actions button {
    background: #e5e7eb;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 0.78rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.reg-tree-head-actions button:hover:not(:disabled) {
    background: #d1d5db;
    color: #2e8795;
}

.reg-tree-head-actions button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Override tree container height inside registration */
.reg-tree-section .tree-container {
    flex: 1 1 auto;
    overflow-y: auto;
    max-height: 440px;
    min-height: 200px;
}

.reg-tree-actions {
    flex: 0 0 auto;
    padding: 10px 14px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    gap: 8px;
    align-items: center;
}

.reg-clear-btn {
    background: #f3f4f6 !important;
    color: #6b7280 !important;
    border: 1px solid #e5e7eb !important;
}

.reg-clear-btn:hover {
    background: #e5e7eb !important;
    color: #374151 !important;
}

/* Search inside tree header */
.reg-help-search {
    margin-bottom: 0;
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .reg-title-row {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 16px 8px;
    }

    .reg-brand-logos {
        order: -1;
    }

    .reg-tree-section {
        max-height: 420px;
    }

    .signin-prompt {
        flex-direction: column;
        text-align: center;
    }

    /* ── Mobile column reorder ──
       On mobile both columns stack to 100%.
       We use flexbox order so:
       1) Left column (form fields + password) appears first  → order: 1
       2) Right column (categories tree) appears second       → order: 2
       3) Submit button area is cloned/moved to bottom.       
       Since we can't reorder WITHIN the left column via CSS alone,
       we make the whole two-col wrapper a flex column and reorder 
       the LEFT column's inner sections.
    */
    .reg-two-col {
        display: flex;
        flex-direction: column;
    }

    .reg-col-left {
        order: 1;
        width: 100%;
    }

    .reg-col-right {
        order: 2;
        width: 100%;
        margin-top: 10px;
    }

    /* The submit button, note, sign-in prompt should appear AFTER categories */
    .reg-col-left .reg-submit-btn {
        display: none !important;
    }

    .reg-col-left .reg-note-wrap,
    .reg-col-left .signin-prompt-wrap,
    .reg-col-left .reg-submit-btn + hr {
        display: none !important;
    }

    /* Panel compact padding */
    .reg-panel {
        padding: 12px 4px;
    }

    .reg-section-title {
        font-size: 1rem;
    }

    /* Form fields compact */
    .reg-field-label {
        font-size: 0.85rem;
    }

    .reg-field-label small {
        display: block;
        margin-left: 0;
        margin-top: 2px;
    }

    /* Hide terms from left column on mobile — it moves to bottom */
    .reg-col-left .reg-terms-wrap {
        display: none !important;
    }
}

/* ── Mobile bottom button (appended via CSS + JS) ───────────────── */
.reg-mobile-bottom-actions {
    display: none;
}

@media (max-width: 767px) {
    .reg-mobile-bottom-actions {
        display: block;
        width: 100%;
        order: 3;
        padding: 16px 15px 8px;
    }

    .reg-terms-mobile {
        margin-bottom: 12px;
        padding: 10px 14px;
        background: #f7f9fb;
        border: 1px solid #e6eef2;
        border-radius: 8px;
    }
    .reg-terms-mobile .reg-checkbox-label {
        font-size: 0.85rem;
        display: flex;
        align-items: flex-start;
        gap: 8px;
        cursor: pointer;
    }
    .reg-terms-mobile input[type="checkbox"] {
        margin-top: 3px;
        flex-shrink: 0;
    }

    .reg-mobile-bottom-actions .reg-mobile-submit-btn {
        display: block;
        width: 100%;
        text-align: center;
        padding: 14px 20px;
        font-size: 1rem;
        font-weight: 700;
        border-radius: 8px;
        background: linear-gradient(135deg, #2e8795 0%, #378b95 100%);
        color: #fff;
        border: none;
        cursor: pointer;
        text-decoration: none;
        transition: all 0.2s;
        box-shadow: 0 4px 12px rgba(46, 135, 149, 0.3);
    }

    .reg-mobile-bottom-actions .reg-mobile-submit-btn:hover {
        background: linear-gradient(135deg, #24707c 0%, #2e8795 100%);
        box-shadow: 0 6px 16px rgba(46, 135, 149, 0.4);
        color: #fff;
        text-decoration: none;
    }

    .reg-mobile-bottom-actions .reg-mobile-submit-btn i {
        margin-right: 6px;
    }

    .reg-mobile-bottom-actions .brand-story {
        margin-top: 12px;
        font-size: 0.8rem;
        padding: 10px 14px;
    }

    .reg-mobile-bottom-actions .signin-prompt {
        margin-top: 10px;
    }
}
