/**
 * 3KS UM Multilang — Frontend styles.
 * Language toggle buttons + smooth transitions.
 */

/* Hide the original UM language dropdown field */
.um-field[data-key="um_preferred_language"] {
    display: none !important;
}

/* Language toggle container */
.um-multilang-toggle {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 25px;
    padding: 12px 0;
}

/* Individual language button */
.um-multilang-toggle .um-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #555;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    line-height: 1;
}

.um-multilang-toggle .um-lang-btn:hover {
    border-color: #741099;
    color: #741099;
}

/* Active language button */
.um-multilang-toggle .um-lang-btn.active {
    border-color: #741099;
    background: #741099;
    color: #fff;
    box-shadow: 0 2px 8px rgba(116, 16, 153, 0.3);
}

.um-multilang-toggle .um-lang-btn.active:hover {
    background: #8a12b8;
    border-color: #8a12b8;
}

/* Flag icon sizing (inline SVG) */
.um-multilang-toggle .um-lang-flag {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}
.um-multilang-toggle .um-lang-flag svg {
    border-radius: 2px;
    box-shadow: 0 0 1px rgba(0,0,0,0.3);
}

/* Smooth transition on label text changes */
.um-field .um-field-label label,
.um-field .um-field-label-text {
    transition: opacity 0.15s ease;
}

/* Account page: toggle sits above the tab panels */
.um-account-main > .um-multilang-toggle {
    margin: 12px 0 18px;
    padding: 8px 0;
}

/* =========================================================================
 * UM Register form — two-row layout (Task 023, bug #2)
 *
 * Layout:
 *   Row 1 (`_um_row_1`)        — standard fields, form width 600px
 *   Row 2 (`_um_row_2`)        — long consent checkboxes, 900px wide
 *                                (extends 300px to the right of row 1)
 *
 * Both rows are LEFT-ALIGNED at the same X coordinate. Row 2 breaks out
 * of the form's max-width by `position: relative` + `left: 0` and the form
 * having `overflow: visible` so the wider row doesn't clip.
 *
 * The wider row is added by provisioning script
 * (_provisioning/007_um_setup.php) as `_um_row_2` with css_class
 * `um-row-consent`.
 * ========================================================================= */

/* Row 1 (whole form) — wider than the UM 450px default */
.um.um-register,
.um-register.um {
    max-width: 600px !important;
    width: 100% !important;
}

@media (max-width: 720px) {
    .um.um-register,
    .um-register.um {
        max-width: calc(100vw - 30px) !important;
    }
}

/* Allow row 2 to escape the 600px form width without clipping */
.um.um-register .um-form,
.um.um-register form {
    overflow: visible !important;
}

/* Row 2 — anchored to row 1's LEFT edge, extends 300px to the right */
.um-row.um-row-consent,
.um-row._um_row_2 {
    position: relative;
    width: 900px !important;
    max-width: 900px !important;
    left: 0 !important;
    margin: 15px 0 0 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
}

@media (max-width: 960px) {
    .um-row.um-row-consent,
    .um-row._um_row_2 {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Inner col of row 2 fills the row, no centering */
.um-row.um-row-consent > .um-col,
.um-row.um-row-consent > .um-col-1,
.um-row._um_row_2 > .um-col,
.um-row._um_row_2 > .um-col-1 {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
}

/* Long consent checkbox text — full row width, no wrap clipping */
.um-field[data-key="um_mailing"],
.um-field[data-key="um_privacy_clause"],
.um-field[data-key="um_terms_conditions"] {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    clear: both !important;
}

.um-field[data-key="um_mailing"] .um-field-area,
.um-field[data-key="um_privacy_clause"] .um-field-area,
.um-field[data-key="um_terms_conditions"] .um-field-area {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
}

.um-field[data-key="um_mailing"] label.um-field-checkbox,
.um-field[data-key="um_privacy_clause"] label.um-field-checkbox,
.um-field[data-key="um_terms_conditions"] label.um-field-checkbox {
    display: flex !important;
    align-items: flex-start !important;
    gap: 8px;
    width: 100% !important;
    max-width: 100% !important;
}

.um-field[data-key="um_mailing"] .um-field-checkbox-option,
.um-field[data-key="um_privacy_clause"] .um-field-checkbox-option,
.um-field[data-key="um_terms_conditions"] .um-field-checkbox-option {
    display: block !important;
    width: auto !important;
    max-width: none !important;
    flex: 1 1 auto !important;
    overflow: visible !important;
    white-space: normal !important;
    word-wrap: break-word;
    line-height: 1.5 !important;
}
