/* Shared MING LIFE authentication UI.
 * Loaded by login.php and dang-ky.php after their legacy page styles.
 */

:root {
    --auth-brand: #078b54;
    --auth-brand-dark: #056b41;
    --auth-brand-deep: #064b34;
    --auth-brand-soft: #edf9f3;
    --auth-ink: #17251e;
    --auth-muted: #718078;
    --auth-border: #dfe8e3;
    --auth-surface: #ffffff;
    --auth-bg: #f6f8f5;
    --auth-shadow: 0 22px 55px rgba(20, 58, 39, .12);
}

/* ================= LOGIN ================= */

.ming-auth-page.auth-container {
    min-height: calc(100vh - 120px);
    padding: 44px 0 52px;
    background: var(--auth-bg);
    overflow: hidden;
}

.ming-auth-page .auth-background {
    position: absolute;
    inset: 0;
    transform: none !important;
    background:
        radial-gradient(circle at 12% 16%, rgba(7, 139, 84, .10), transparent 26%),
        radial-gradient(circle at 88% 78%, rgba(181, 144, 80, .10), transparent 24%),
        linear-gradient(135deg, #f8faf7 0%, #eef6f1 54%, #fbf8f1 100%);
    background-size: auto;
    animation: none;
}

.ming-auth-page .auth-background::before {
    inset: 0;
    background-image:
        linear-gradient(rgba(7,139,84,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(7,139,84,.035) 1px, transparent 1px);
    background-size: 32px 32px;
    animation: none;
}

.ming-auth-page .auth-overlay {
    background: transparent;
    backdrop-filter: none;
}

.ming-auth-page .container-fluid,
.ming-auth-page .row {
    position: relative;
    z-index: 1;
}

.ming-auth-page .auth-card {
    overflow: hidden;
    position: relative;
    margin: 0 auto;
    border: 1px solid rgba(7,139,84,.13);
    border-radius: 22px;
    background: rgba(255,255,255,.97);
    box-shadow: var(--auth-shadow);
    opacity: 1;
    transform: none;
    backdrop-filter: blur(12px);
}

.ming-auth-page .auth-card::before {
    height: 4px;
    background: linear-gradient(90deg, var(--auth-brand-dark), var(--auth-brand), #37b77c);
    background-size: auto;
    animation: none;
}

.ming-auth-page .auth-card:hover {
    transform: none;
    box-shadow: var(--auth-shadow);
}

.ming-auth-page .auth-card-header {
    padding: 30px 28px 18px;
    text-align: center;
    background:
        radial-gradient(circle at 50% 0%, rgba(7,139,84,.08), transparent 52%),
        linear-gradient(180deg,#fff,#fbfdfc);
}

.ming-auth-page .auth-logo img {
    height: 64px;
    margin-bottom: 14px !important;
    filter: none;
}

.ming-auth-page .auth-logo img:hover {
    transform: none;
}

.ming-auth-page .auth-kicker {
    display: block;
    margin-bottom: 5px;
    color: var(--auth-brand);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .9px;
    text-transform: uppercase;
}

.ming-auth-page .auth-title {
    margin: 0 0 5px;
    color: var(--auth-ink);
    font-size: 23px;
    line-height: 1.2;
    font-weight: 850;
    text-shadow: none;
}

.ming-auth-page .auth-title i {
    color: var(--auth-brand);
}

.ming-auth-page .auth-subtitle {
    margin: 0;
    color: var(--auth-muted);
    font-size: 12px;
    line-height: 1.5;
}

.ming-auth-page .auth-trust-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 13px;
}

.ming-auth-page .auth-trust-row span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 26px;
    padding: 0 8px;
    border: 1px solid #d9e9e0;
    border-radius: 999px;
    color: #66766d;
    background: #f7fbf9;
    font-size: 8px;
    font-weight: 700;
}

.ming-auth-page .auth-trust-row i {
    color: var(--auth-brand);
}

.ming-auth-page .auth-card-body {
    padding: 18px 28px 30px;
}

.ming-auth-page .auth-form {
    animation: none;
}

.ming-auth-page .form-floating {
    position: relative;
}

.ming-auth-page .form-floating > .auth-input {
    min-height: 54px;
    padding: 1.15rem 42px 0.35rem 44px;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    color: #26372e;
    background: #fff;
    box-shadow: none;
    backdrop-filter: none;
    font-size: 13px;
}

.ming-auth-page .form-floating > .auth-input:focus {
    border-color: #6aba94;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(7,139,84,.08);
    transform: none;
}

.ming-auth-page .form-floating > label {
    padding: 1rem 42px 1rem 44px;
    color: #7c8982;
    font-size: 12px;
    font-weight: 650;
}

.ming-auth-page .form-floating > label i {
    position: absolute;
    left: 15px;
    top: 19px;
    color: #8b9991;
}

.ming-auth-page .form-floating > .auth-input:focus ~ label,
.ming-auth-page .form-floating > .auth-input:not(:placeholder-shown) ~ label {
    color: var(--auth-brand);
    font-weight: 700;
}

.ming-auth-page .password-toggle {
    right: 8px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    padding: 0;
    color: #78867e;
    border-radius: 9px;
}

.ming-auth-page .password-toggle:hover {
    color: var(--auth-brand);
    background: var(--auth-brand-soft);
}

.ming-auth-page .auth-options {
    margin-top: 2px;
    margin-bottom: 17px !important;
}

.ming-auth-page .form-check-label {
    color: #58675f;
    font-size: 10px;
}

.ming-auth-page .form-check-input {
    border-color: #aebbb4;
    box-shadow: none;
}

.ming-auth-page .form-check-input:checked {
    border-color: var(--auth-brand);
    background-color: var(--auth-brand);
}

.ming-auth-page .forgot-password,
.ming-auth-page .switch-link,
.ming-auth-page .terms-link {
    color: var(--auth-brand);
    font-weight: 750;
}

.ming-auth-page .forgot-password {
    font-size: 10px;
}

.ming-auth-page .forgot-password:hover,
.ming-auth-page .switch-link:hover,
.ming-auth-page .terms-link:hover {
    color: var(--auth-brand-dark);
}

.ming-auth-page .auth-btn {
    min-height: 47px;
    padding: 0 18px;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 850;
}

.ming-auth-page .auth-btn-primary,
.ming-auth-page .auth-btn-success {
    color: #fff;
    background: linear-gradient(135deg,var(--auth-brand-dark),var(--auth-brand));
    box-shadow: 0 8px 18px rgba(7,139,84,.18);
}

.ming-auth-page .auth-btn-primary:hover,
.ming-auth-page .auth-btn-success:hover {
    color: #fff;
    background: linear-gradient(135deg,#045f39,#087f4d);
    box-shadow: 0 10px 22px rgba(7,139,84,.22);
    transform: translateY(-1px);
}

.ming-auth-page .auth-divider {
    margin: 17px 0;
}

.ming-auth-page .auth-divider::before {
    background: linear-gradient(90deg,transparent,#e1e8e4,transparent);
}

.ming-auth-page .auth-divider span {
    color: #8c9791;
    background: #fff;
    font-size: 9px;
}

.ming-auth-page .switch-form {
    color: #68766e;
    font-size: 10px;
}

.ming-auth-page .form-text {
    margin-left: 0;
    color: #87938c;
    font-size: 8px;
}

/* Login modals */
.ming-auth-page ~ .modal .auth-modal,
#loading-modal .auth-modal,
#success-modal .auth-modal {
    overflow: hidden;
    border: 0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15,35,24,.20);
    backdrop-filter: none;
}

#loading-modal .spinner-ring div {
    border-top-color: var(--auth-brand);
}

#success-modal .success-header {
    padding: 16px 18px;
    border-radius: 0;
    color: #fff;
    background: linear-gradient(135deg,var(--auth-brand-dark),#10a265);
}

#success-modal .success-icon {
    color: var(--auth-brand);
}

/* ================= REGISTER ================= */

.ming-register-page {
    position: relative;
    min-height: calc(100vh - 120px);
    padding-top: 42px !important;
    padding-bottom: 52px !important;
    background:
        radial-gradient(circle at 12% 12%, rgba(7,139,84,.09), transparent 25%),
        radial-gradient(circle at 89% 85%, rgba(181,144,80,.08), transparent 22%),
        linear-gradient(135deg,#f8faf7 0%,#eff6f2 55%,#fbf8f1 100%);
}

.ming-register-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(7,139,84,.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(7,139,84,.03) 1px, transparent 1px);
    background-size: 34px 34px;
    pointer-events: none;
}

.ming-register-page > * {
    position: relative;
    z-index: 1;
}

.ming-register-page #register-auth-guard {
    min-height: 330px;
}

.ming-register-page .register-auth-check {
    padding: 20px 24px;
    border: 1px solid #dbe8e1;
    border-radius: 15px;
    background: rgba(255,255,255,.92);
    box-shadow: 0 12px 30px rgba(26,61,43,.07);
}

.ming-register-page .register-shell {
    display: grid;
    grid-template-columns: minmax(260px,.72fr) minmax(0,1.55fr);
    overflow: hidden;
    max-width: 1080px;
    margin: 0 auto;
    border: 1px solid rgba(7,139,84,.14);
    border-radius: 22px;
    background: #fff;
    box-shadow: var(--auth-shadow);
}

.ming-register-page .register-brand-panel {
    position: relative;
    overflow: hidden;
    padding: 34px 30px;
    color: #fff;
    background:
        radial-gradient(circle at 88% 10%,rgba(255,255,255,.16),transparent 25%),
        linear-gradient(155deg,#064c35 0%,#078b54 65%,#12a66a 100%);
}

.ming-register-page .register-brand-panel::after {
    content: '';
    position: absolute;
    right: -70px;
    bottom: -70px;
    width: 220px;
    height: 220px;
    border: 35px solid rgba(255,255,255,.05);
    border-radius: 50%;
}

.ming-register-page .register-brand-panel > * {
    position: relative;
    z-index: 1;
}

.ming-register-page .register-brand-mark {
    width: 80px;
    height: 80px;
    display: grid;
    place-items: center;
    margin-bottom: 26px;
    border-radius: 18px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 10px 25px rgba(0,0,0,.10);
}

.ming-register-page .register-brand-mark img {
    max-width: 68px;
    max-height: 68px;
    object-fit: contain;
}

.ming-register-page .register-brand-kicker {
    display: block;
    margin-bottom: 6px;
    color: rgba(255,255,255,.72);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .9px;
    text-transform: uppercase;
}

.ming-register-page .register-brand-panel h1 {
    max-width: 270px;
    margin: 0 0 10px;
    color: #fff;
    font-size: 27px;
    line-height: 1.15;
    font-weight: 850;
    letter-spacing: -.4px;
}

.ming-register-page .register-brand-panel > p {
    margin: 0;
    color: rgba(255,255,255,.76);
    font-size: 11px;
    line-height: 1.65;
}

.ming-register-page .register-benefits {
    display: grid;
    gap: 11px;
    margin-top: 28px;
}

.ming-register-page .register-benefits > div {
    display: grid;
    grid-template-columns: 32px minmax(0,1fr);
    gap: 9px;
    align-items: start;
}

.ming-register-page .register-benefits i {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: #fff;
    background: rgba(255,255,255,.12);
    font-size: 11px;
}

.ming-register-page .register-benefits span {
    padding-top: 3px;
    color: rgba(255,255,255,.82);
    font-size: 9px;
    line-height: 1.5;
}

.ming-register-page .register-brand-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 28px;
    padding: 10px 11px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 10px;
    color: rgba(255,255,255,.73);
    background: rgba(255,255,255,.08);
    font-size: 8px;
    line-height: 1.5;
}

.ming-register-page .register-brand-note i {
    margin-top: 2px;
}

.ming-register-page .register-form-card {
    min-width: 0;
    background: #fff;
}

.ming-register-page .register-form-heading {
    padding: 28px 30px 18px;
    border-bottom: 1px solid #e8eeea;
    background: linear-gradient(180deg,#fff,#fbfdfc);
}

.ming-register-page .register-form-kicker {
    display: block;
    color: var(--auth-brand);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .8px;
    text-transform: uppercase;
}

.ming-register-page .register-form-heading h2 {
    margin: 3px 0 5px;
    color: var(--auth-ink);
    font-size: 23px;
    font-weight: 850;
    letter-spacing: -.3px;
}

.ming-register-page .register-form-heading p {
    margin: 0;
    color: var(--auth-muted);
    font-size: 10px;
    line-height: 1.5;
}

.ming-register-page .register-form-heading p strong {
    color: #bd4848;
}

.ming-register-page .register-form-body {
    padding: 23px 30px 28px;
}

.ming-register-page #register-alert,
.ming-register-page .alert {
    border: 0;
    border-radius: 11px;
    font-size: 10px;
    line-height: 1.5;
}

.ming-register-page #register-form .form-label {
    margin-bottom: 6px;
    color: #405148;
    font-size: 10px;
    font-weight: 750;
}

.ming-register-page #register-form .form-control,
.ming-register-page #register-form .form-select {
    min-height: 44px;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    color: #293a31;
    background: #fff;
    box-shadow: none;
    font-size: 12px;
}

.ming-register-page #register-form .form-control::placeholder {
    color: #a0aaa4;
}

.ming-register-page #register-form .form-control:focus,
.ming-register-page #register-form .form-select:focus {
    border-color: #6aba94;
    box-shadow: 0 0 0 3px rgba(7,139,84,.08);
}

.ming-register-page #register-form .form-control[readonly] {
    color: #57665e;
    background: #f5f8f6;
}

.ming-register-page #register-form .input-group .form-control {
    border-radius: 10px 0 0 10px;
}

.ming-register-page #register-form .input-group .btn {
    min-width: 44px;
    border: 1px solid var(--auth-border);
    border-left: 0;
    border-radius: 0 10px 10px 0;
    color: #748179;
    background: #fff;
}

.ming-register-page #register-form .input-group .btn:hover {
    color: var(--auth-brand);
    background: var(--auth-brand-soft);
}

.ming-register-page #register-form .form-text {
    margin: 5px 0 0;
    color: #87938c;
    font-size: 8px;
    line-height: 1.45;
}

.ming-register-page #register-form .invalid-feedback {
    font-size: 8px;
    line-height: 1.4;
}

.ming-register-page #register-form .form-control.is-valid,
.ming-register-page #register-form .form-select.is-valid {
    border-color: #64ad88;
    box-shadow: none;
}

.ming-register-page #register-form .form-control.is-invalid,
.ming-register-page #register-form .form-select.is-invalid {
    border-color: #d35e5e;
    box-shadow: 0 0 0 3px rgba(211,94,94,.06);
}

.ming-register-page #register-form > .form-check {
    margin-top: 3px;
    padding: 11px 12px 11px 35px;
    border: 1px solid #e2e9e5;
    border-radius: 10px;
    background: #fbfcfb;
}

.ming-register-page #register-form > .form-check .form-check-input {
    margin-left: -23px;
    border-color: #aebbb4;
}

.ming-register-page #register-form > .form-check .form-check-input:checked {
    border-color: var(--auth-brand);
    background-color: var(--auth-brand);
}

.ming-register-page #register-form > .form-check .form-check-label {
    color: #637169;
    font-size: 9px;
    line-height: 1.5;
}

.ming-register-page #register-form > .form-check a {
    color: var(--auth-brand);
    font-weight: 750;
}

.ming-register-page .register-submit-btn {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--auth-brand);
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(135deg,var(--auth-brand-dark),var(--auth-brand));
    font-size: 11px;
    font-weight: 850;
    box-shadow: 0 8px 18px rgba(7,139,84,.17);
}

.ming-register-page .register-submit-btn:hover {
    color: #fff;
    border-color: var(--auth-brand-dark);
    background: linear-gradient(135deg,#045f39,#087f4d);
    transform: translateY(-1px);
}

.ming-register-page .register-submit-btn:disabled {
    opacity: .65;
    transform: none;
    box-shadow: none;
}

.ming-register-page #register-form hr {
    margin: 18px 0 !important;
    border-color: #e5ebe7;
    opacity: 1;
}

.ming-register-page .register-login-link p {
    margin: 0;
    color: #69776f;
    font-size: 10px;
}

.ming-register-page .register-login-link a {
    color: var(--auth-brand);
    font-weight: 800;
    text-decoration: none;
}

/* Register modals */
#termsModal .modal-content,
#privacyModal .modal-content {
    overflow: hidden;
    border: 0;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(15,35,24,.20);
}

#termsModal .modal-header,
#privacyModal .modal-header {
    border-bottom: 1px solid #dfe8e3;
    background: #f4faf7;
}

#termsModal .modal-title,
#privacyModal .modal-title {
    color: #304239;
    font-size: 15px;
    font-weight: 850;
}

#termsModal .modal-body,
#privacyModal .modal-body {
    color: #5f6e66;
    font-size: 10px;
    line-height: 1.65;
}

#termsModal .alert-warning,
#privacyModal .alert-warning {
    border: 1px solid #eadba8;
    color: #7d641d;
    background: #fff9e8;
}

#termsModal .modal-footer,
#privacyModal .modal-footer {
    border-top: 1px solid #e5ebe7;
}

#termsModal .modal-footer .btn,
#privacyModal .modal-footer .btn {
    min-width: 90px;
    border-radius: 9px;
    font-size: 9px;
    font-weight: 750;
}

/* ================= RESPONSIVE ================= */

@media (max-width: 991.98px) {
    .ming-register-page .register-shell {
        grid-template-columns: 1fr;
        max-width: 760px;
    }

    .ming-register-page .register-brand-panel {
        padding: 26px 28px;
    }

    .ming-register-page .register-brand-mark {
        width: 68px;
        height: 68px;
        margin-bottom: 18px;
    }

    .ming-register-page .register-brand-mark img {
        max-width: 58px;
        max-height: 58px;
    }

    .ming-register-page .register-brand-panel h1 {
        max-width: none;
        font-size: 24px;
    }

    .ming-register-page .register-benefits {
        grid-template-columns: repeat(3,minmax(0,1fr));
        margin-top: 20px;
    }

    .ming-register-page .register-benefits > div {
        grid-template-columns: 28px minmax(0,1fr);
    }

    .ming-register-page .register-benefits i {
        width: 28px;
        height: 28px;
    }

    .ming-register-page .register-brand-note {
        margin-top: 18px;
    }
}

@media (max-width: 767.98px) {
    .ming-auth-page.auth-container {
        min-height: auto;
        padding: 18px 12px 32px;
    }

    .ming-auth-page .auth-card {
        margin: 0;
        border-radius: 17px;
    }

    .ming-auth-page .auth-card-header {
        padding: 24px 18px 15px;
    }

    .ming-auth-page .auth-logo img {
        height: 54px;
    }

    .ming-auth-page .auth-title {
        font-size: 20px;
    }

    .ming-auth-page .auth-card-body {
        padding: 15px 18px 24px;
    }

    .ming-auth-page .auth-options {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    .ming-register-page {
        padding: 18px 12px 32px !important;
    }

    .ming-register-page .container {
        padding-left: 0;
        padding-right: 0;
    }

    .ming-register-page .register-shell {
        border-radius: 17px;
    }

    .ming-register-page .register-brand-panel {
        padding: 22px 18px;
    }

    .ming-register-page .register-brand-mark {
        width: 58px;
        height: 58px;
        margin-bottom: 14px;
        border-radius: 14px;
    }

    .ming-register-page .register-brand-mark img {
        max-width: 50px;
        max-height: 50px;
    }

    .ming-register-page .register-brand-panel h1 {
        font-size: 21px;
    }

    .ming-register-page .register-benefits {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-top: 17px;
    }

    .ming-register-page .register-brand-note {
        display: none;
    }

    .ming-register-page .register-form-heading {
        padding: 21px 17px 14px;
    }

    .ming-register-page .register-form-heading h2 {
        font-size: 20px;
    }

    .ming-register-page .register-form-body {
        padding: 17px;
    }

    .ming-register-page #register-form .row {
        --bs-gutter-x: 12px;
    }

    .ming-register-page #register-form .form-control,
    .ming-register-page #register-form .form-select {
        min-height: 45px;
        font-size: 13px;
    }

    .ming-register-page .register-submit-btn {
        min-height: 47px;
    }
}

@media (max-width: 420px) {
    .ming-auth-page .auth-options {
        flex-direction: column;
        align-items: flex-start;
    }

    .ming-auth-page .auth-trust-row {
        gap: 5px;
    }

    .ming-register-page .register-brand-panel > p {
        font-size: 10px;
    }
}
