@import "components/_user-registration-errors.css";

/**
 * CSS cho trang đăng ký
 * CSS for registration page
 * timestamp: Monday, June 16, 2025 8:07:28 AM - quyen modify
 * @file wp-content/themes/astra-child-deutschfuns/assets/css/fong-register.css
 * @module registration
 * @description Định dạng giao diện form đăng ký theo thiết kế mới
 * @dependencies
 * - Font Montserrat
 * - Font Awesome Icons
 */

/* Reset & Base styles */
.fong-register-page {
    margin: 0;
    font-family: "Montserrat", sans-serif;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Ẩn thanh cuộn cho Chrome, Safari và Opera */
.fong-register-page::-webkit-scrollbar {
    display: none;
}

/* Background styles */
.bg_login {
    width: 100%;
    min-height: 100vh;
    position: relative;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    display: flex;
    flex-direction: column;
}

.bg_cloud {
    background-image: url("../images/background_login_2.png");
    width: 100%;
    min-height: 100vh;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    background-position: center center;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}

/* Ẩn thanh cuộn cho Chrome, Safari và Opera */
.bg_login::-webkit-scrollbar {
    display: none;
}

/* Layout & Container */
.wrapper_layout {
    width: 90%;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 2;
    /* padding: 30px 0; */
    flex: 1;
    min-height: 100vh;
}

.help_center {
    position: fixed;
    top: 40px;
    right: 20px;
    z-index: 100;
    width: auto;
    height: auto;
}

.help_center img {
    width: 44px;
    height: 44px;
    display: block;
}

.group_content {
    width: 100%;
    max-width: 440px;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    margin: auto;
    position: relative;
    z-index: 3;
    padding-bottom: 100px;
}

/* Form Container */
.container_login {
    display: flex;
    align-items: center;
    flex-direction: column;
    width: 100%;
    /* margin: 20px 0; */
}

/* User Registration Form Styles */
.ur-frontend-form {
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    box-shadow: none;
    background: transparent;
}

/* Form Row Layout */
.ur-form-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
}

/* Special styling for all rows except row-id 0 */
.ur-form-row:not([data-row-id="0"]) {
    flex-direction: column;
    gap: 0;
}

.ur-form-row:not([data-row-id="0"]) .ur-form-grid {
    max-width: 100% !important;
    width: 100% !important;
    flex: none;
}

.ur-form-row:not([data-row-id="0"]) .ur-field-item {
    margin-bottom: 0;
}

.ur-form-row:not([data-row-id="0"]) .input-wrapper {
    width: 100%;
}

.ur-form-row:not([data-row-id="0"]) input[type="text"],
.ur-form-row:not([data-row-id="0"]) input[type="email"],
.ur-form-row:not([data-row-id="0"]) input[type="password"],
.ur-form-row:not([data-row-id="0"]) input[type="tel"] {
    width: 100%;
    margin-bottom: 30px;
}

/* Form Grid Layout */
.ur-form-grid.ur-grid-1,
.ur-form-grid.ur-grid-2 {
    flex: 1;
    max-width: calc(50% - 10px);
    width: calc(50% - 10px) !important;
    margin: 0;
}

/* Form Fields */
.ur-frontend-form .ur-form-row .ur-form-grid .ur-field-item {
    margin-bottom: 0;
}

/* Password Input Group */
.password-input-group {
    position: relative;
    display: block;
    width: 100%;
}

.password-input-group input[type="password"] {
    padding-right: 50px !important;
    /* Space for icon */
}

/* Password Preview Icon */
.password_preview {
    position: absolute;
    right: 20px;
    top: 16px;
    /* Match input padding */
    height: 20px;
    line-height: 20px;
    cursor: pointer;
    color: #6c7074;
    text-decoration: none;
    z-index: 2;
    display: flex;
    align-items: center;
}

.password_preview:before {
    font-size: 20px;
}

.ur-frontend-form .ur-label {
    display: none !important;
    /* Ẩn hoàn toàn label */
}

.ur-frontend-form .input-wrapper {
    width: 100%;
    display: block;
}

.ur-frontend-form input[type="text"],
.ur-frontend-form input[type="email"],
.ur-frontend-form input[type="password"],
.ur-frontend-form input[type="tel"] {
    width: 100%;
    box-sizing: border-box;
    padding: 16px 20px;
    border: 1px solid #dfdfdf;
    border-radius: 30px;
    color: #6c7074;
    outline: none;
    margin-bottom: 30px;
    background: #fff;
}

/* Button Container */
.ur-button-container {
    --fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands";
    --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Free";
    --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Free";
    font-family: "Montserrat", sans-serif;
    box-sizing: border-box;
    width: 100%;
    border: 4px solid rgba(0, 195, 197, 0.2);
    border-radius: 36px;
    margin-bottom: 20px;
}

/* Submit Button */
.ur-frontend-form button[type="submit"],
.ur-frontend-form input[type="submit"],
.ur-frontend-form .ur-submit-button {
    color: #ffffff;
    text-transform: uppercase;
    font-size: 15px;
    font-family: "montserrat-bold", "Montserrat", sans-serif;
    font-weight: 700;
    background-color: #21a7a8;
    padding: 17px 0;
    width: 100%;
    border: none;
    border-radius: 36px;
    cursor: pointer;
    margin: 0;
    /* Reset margin */
    display: block;
}

.ur-submit-button:disabled {
    opacity: 1 !important;
}

.ur-frontend-form button[type="submit"]:hover,
.ur-frontend-form input[type="submit"]:hover,
.ur-frontend-form .ur-submit-button:hover {
    background-color: #1c9596;
    color: #ffffff;
}

/* Login Link */
._register {
    display: flex;
    justify-content: center;
    align-items: center;
    /* margin-top: 20px; */
}

._register span {
    color: #323334;
    margin-right: 5px;
}

._register a {
    color: #21a7a8;
    font-size: 14px;
    font-weight: 600;
    line-height: 26px;
    text-decoration: none;
}

/* Error Messages */
.ur-frontend-form .ur-error-message,
.user-registration-error {
    color: #ff4141;
    text-align: left;
    margin: -25px 0 15px 20px;
    /* margin: 10px 0 15px 20px; */
    font-size: 13px;
    font-family: "Montserrat", sans-serif;
    display: block;
}

/* Password Strength Error */
#user_pass_error.user-registration-error {
    margin: -10px 0 15px 20px;
}

/* Special styling for row-id 3 error messages */
.ur-form-row[data-row-id="3"] .user-registration-error {
    margin: -25px 0 15px 20px;
}

@media screen and (max-width: 1025px) and (min-width: 461px) {
    .bg_cloud {
        background-position: center;
    }

    /* Cho phép row chứa display_name và user_login hiển thị theo chiều ngang */
    .ur-form-row[data-row-id="0"] {
        flex-direction: row !important;
        gap: 10px;
    }

    /* Set width cho 2 field này */
    .ur-form-row[data-row-id="0"] .ur-form-grid {
        max-width: calc(50% - 5px) !important;
        width: calc(50% - 5px) !important;
    }

    /* Đảm bảo input fields có width 100% */
    .ur-form-row[data-row-id="0"] input[type="text"] {
        width: 100%;
        margin-bottom: 15px !important;
    }

    /* CSS cho các row khác vẫn giữ nguyên */
    .ur-form-row:not([data-row-id="0"]) {
        flex-direction: column;
    }
}

/* Responsive Design */
/* Tablet: Màn hình từ 461px đến 1025px */
@media screen and (max-width: 1025px) and (min-width: 461px) {
    /* Căn giữa background */
    .bg_cloud {
        background-position: center;
    }

    /* Row đầu tiên (chứa display_name và user_login) */
    /* Hiển thị 2 field theo chiều ngang */
    .ur-form-row[data-row-id="0"] {
        flex-direction: row !important;
        gap: 10px;
    }

    /* Set width cho 2 field trong row đầu tiên */
    /* Mỗi field chiếm 50% width trừ đi gap */
    .ur-form-row[data-row-id="0"] .ur-form-grid {
        max-width: calc(50% - 5px) !important;
        width: calc(50% - 5px) !important;
    }

    /* Input fields trong row đầu tiên */
    /* Width 100% và margin bottom 10px */
    .ur-form-row[data-row-id="0"] input[type="text"] {
        width: 100%;
        margin-bottom: 10px !important;
    }

    /* Các row khác (không phải row đầu tiên) */
    /* Hiển thị theo chiều dọc */
    .ur-form-row:not([data-row-id="0"]) {
        flex-direction: column;
    }
}

/* Mobile: Màn hình nhỏ hơn 460px */
@media screen and (max-width: 460px) {
    /* .bg_cloud {
        background-position: 100% 120px;
    } */

    .container_login form {
        width: 100%;
    }

    /* Header login */
    .header_login {
        margin: 10px 0px 0px 0px;
    }

    /* Row đầu tiên (chứa display_name và user_login) */
    /* Vẫn giữ layout ngang nhưng với gap nhỏ hơn */
    .ur-form-row[data-row-id="0"] {
        flex-direction: row !important;
        gap: 10px;
    }

    /* Set width cho 2 field trong row đầu tiên */
    /* Mỗi field chiếm 50% width trừ đi gap */
    .ur-form-row[data-row-id="0"] .ur-form-grid {
        max-width: calc(50% - 5px) !important;
        width: calc(50% - 5px) !important;
    }

    /* Input fields trong row đầu tiên */
    /* Width 100% và margin bottom 10px */
    .ur-form-row[data-row-id="0"] input[type="text"] {
        width: 100%;
        /* margin-bottom: 10px !important; */ /* Modified by Quyên - Sunday, June 15, 2025 10:33:00 PM */
        margin-bottom: 30px !important; /* Modified by Quyên - Sunday, June 15, 2025 10:33:00 PM */
    }

    /* Các row khác (không phải row đầu tiên) */
    /* Hiển thị theo chiều dọc */
    .ur-form-row:not([data-row-id="0"]) {
        flex-direction: column;
    }

    /* Form grid trong các row khác */
    /* Width 100% */
    .ur-frontend-form .ur-form-row .ur-form-grid {
        width: 100%;
    }

    /* Input fields trong các row khác */
    /* Margin bottom 15px */
    .ur-frontend-form input[type="text"],
    .ur-frontend-form input[type="email"],
    .ur-frontend-form input[type="password"],
    .ur-frontend-form input[type="tel"] {
        margin-bottom: 15px;
    }
}

/* Tablet Landscape: Màn hình từ 768px đến 1024px */
@media screen and (min-width: 768px) and (max-width: 1024px) {
    /* Input fields trong form row */
    /* Margin right 10px và không có margin bottom */
    .ur-form-row input {
        margin-right: 10px;
        margin-bottom: 0;
    }

    /* Input field cuối cùng trong row */
    /* Không có margin right */
    .ur-form-row input:last-child {
        margin-right: 0;
    }

    /* Display name và user login fields */
    /* Margin bottom 30px */
    #display_name,
    #user_login {
        margin-bottom: 30px !important;
    }
}

/* Utility Classes */
.flex_start {
    justify-content: flex-start;
}

.mt_60px {
    margin-top: 60px;
}

.pos_relative {
    position: relative;
}

/* Header & Logo */
.header_login {
    width: 100%;
    display: flex;
    justify-content: center;
}

.logo_deutschfuns {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 40px 0px 150px 0px;
    height: 138px;
}

.logo_deutschfuns img {
    width: 220px;
    height: auto;
}

/* Password Strength Meter */
.user-registration-password-strength {
    padding: 8px 15px;
    /* margin: -20px 0 20px; */
    margin: 0 0 20px 15px;
    border-radius: 15px;
    display: inline-block;
    width: auto;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
}

.user-registration-password-strength.short {
    background-color: #ffe5e5;
    border-color: #f5c6cb;
    color: #ff4141;
}

.user-registration-password-strength.bad {
    background-color: #fff3cd;
    border-color: #ffeeba;
    color: #856404;
}

.user-registration-password-strength.good {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.user-registration-password-strength.strong {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* Password Hint */
.user-registration-password-hint {
    font-size: 12px;
    font-style: italic;
    color: #6c7074;
    margin: -15px 0 20px;
    display: block;
    padding-left: 15px;
}

/* Button loading state */
.fong-register-submit-button.fong-loading {
    position: relative;
    cursor: wait;
    opacity: 0.8;
}

/* Spinner animation */
.fong-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: fong-spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes fong-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Validation styles */
.ur-error-message {
    color: #d63638;
    font-size: 14px;
    margin-top: 5px;
}

.ur-error {
    border-color: #d63638 !important;
}
