/* ==========================================================
   PLAYER AUTHENTICATION
   Compact ERP / Application UI
========================================================== */

/* ----------------------------------------------------------
   PAGE
---------------------------------------------------------- */

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}


/* ----------------------------------------------------------
   AUTH PAGE
---------------------------------------------------------- */

.auth-page {
    width: 100%;
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;
    box-sizing: border-box;

    background:
        radial-gradient(
            circle at 10% 10%,
            rgba(22, 163, 74, .07),
            transparent 30%
        ),
        radial-gradient(
            circle at 90% 90%,
            rgba(22, 163, 74, .05),
            transparent 30%
        ),
        var(--bg);
}


/* ----------------------------------------------------------
   MAIN AUTH CONTAINER
---------------------------------------------------------- */

.auth-shell {
    width: 100%;
    max-width: 920px;

    min-height: 540px;

    display: grid;
    grid-template-columns: 42% 58%;

    overflow: hidden;

    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 18px;

    box-shadow: var(--shadow-lg);
}


/* ----------------------------------------------------------
   LEFT BRAND PANEL
---------------------------------------------------------- */

.auth-brand-panel {
    position: relative;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    padding: 38px;
    box-sizing: border-box;

    color: #fff;

    background:
        linear-gradient(
            145deg,
            #16a34a 0%,
            #15803d 55%,
            #166534 100%
        );
}

html[data-theme="dark"] .auth-brand-panel {
    background:
        linear-gradient(
            145deg,
            #14532d 0%,
            #166534 55%,
            #064e3b 100%
        );
}


/* ----------------------------------------------------------
   BRAND
---------------------------------------------------------- */

.auth-brand-logo {
    display: flex;
    align-items: center;

    gap: 11px;

    margin-bottom: 45px;
}

.auth-brand-icon {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 10px;

    background: rgba(255, 255, 255, .15);

    font-size: 19px;
}

.auth-brand-name {
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
}

.auth-brand-tagline {
    margin-top: 3px;

    color: rgba(255, 255, 255, .68);

    font-size: 10px;
    line-height: 1.3;
}


/* ----------------------------------------------------------
   BRAND CONTENT
---------------------------------------------------------- */

.auth-brand-content h1 {
    margin: 0 0 15px;

    color: #fff;

    font-size: clamp(32px, 3vw, 42px);
    font-weight: 800;
    line-height: 1.04;

    letter-spacing: -.04em;
}

.auth-brand-description {
    max-width: 360px;

    margin: 0;

    color: rgba(255, 255, 255, .78);

    font-size: 13px;
    line-height: 1.6;
}


/* ----------------------------------------------------------
   FEATURES
---------------------------------------------------------- */

.auth-feature-list {
    display: flex;
    flex-direction: column;

    gap: 10px;

    margin: 25px 0 0;
    padding: 0;

    list-style: none;
}

.auth-feature {
    display: flex;
    align-items: center;

    gap: 9px;

    color: rgba(255, 255, 255, .88);

    font-size: 12px;
}

.auth-feature-icon {
    width: 21px;
    height: 21px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 50%;

    background: rgba(255, 255, 255, .14);

    font-size: 10px;
    font-weight: 800;
}


/* ----------------------------------------------------------
   BRAND FOOTER
---------------------------------------------------------- */

.auth-brand-footer {
    color: rgba(255, 255, 255, .55);

    font-size: 10px;
}


/* ----------------------------------------------------------
   RIGHT FORM PANEL
---------------------------------------------------------- */

.auth-form-panel {
    position: relative;

    min-width: 0;

    display: flex;
    flex-direction: column;

    background: var(--card-bg);
}


/* ----------------------------------------------------------
   TOP BAR / THEME BUTTON
---------------------------------------------------------- */

.auth-form-top {
    display: flex;
    justify-content: flex-end;

    padding: 14px 18px 0;
}

.auth-theme-toggle {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid var(--border);
    border-radius: 50%;

    background: var(--card-bg);
    color: var(--text);

    cursor: pointer;

    font-size: 15px;

    transition:
        background var(--transition),
        border-color var(--transition),
        transform var(--transition);
}

.auth-theme-toggle:hover {
    background: var(--card-hover);
    border-color: var(--border-strong);

    transform: translateY(-1px);
}


/* ----------------------------------------------------------
   FORM CONTENT
---------------------------------------------------------- */

.auth-form-content {
    width: 100%;
    max-width: 430px;

    margin: auto;

    padding: 20px 38px 35px;

    box-sizing: border-box;
}


/* ----------------------------------------------------------
   FORM HEADING
---------------------------------------------------------- */

.auth-heading {
    margin-bottom: 20px;
}

.auth-heading h2 {
    margin: 0 0 6px;

    color: var(--text);

    font-size: 25px;
    font-weight: 800;
    line-height: 1.2;

    letter-spacing: -.03em;
}

.auth-heading p {
    margin: 0;

    color: var(--muted);

    font-size: 13px;
    line-height: 1.55;
}


/* ----------------------------------------------------------
   MESSAGE
---------------------------------------------------------- */

.auth-message {
    width: 100%;

    margin-bottom: 15px;
}

.auth-message:empty {
    display: none;
}

.auth-message .flash {
    width: 100%;

    box-sizing: border-box;

    margin: 0;

    border-radius: 8px;

    font-size: 12px;
    line-height: 1.45;
}


/* ----------------------------------------------------------
   STANDARD LOGIN FORM
---------------------------------------------------------- */

.auth-form {
    width: 100%;

    display: flex;
    flex-direction: column;

    gap: 14px;

    margin: 0;
    padding: 0;
}


/* ----------------------------------------------------------
   FORM FIELDS
---------------------------------------------------------- */

.auth-field {
    width: 100%;

    display: flex;
    flex-direction: column;

    gap: 5px;

    margin: 0;
    padding: 0;
}

.auth-field label {
    display: block;

    color: var(--text);

    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}


/* ----------------------------------------------------------
   INPUTS
---------------------------------------------------------- */

.auth-field input,
.auth-field select,
.auth-field textarea {
    width: 100%;

    min-height: 42px;

    box-sizing: border-box;

    margin: 0;
    padding: 9px 12px;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--input-bg);
    color: var(--text);

    font-family: inherit;
    font-size: 13px;

    outline: none;

    transition:
        border-color var(--transition),
        box-shadow var(--transition),
        background var(--transition);
}

.auth-field input:hover,
.auth-field select:hover,
.auth-field textarea:hover {
    border-color: var(--border-strong);
}

.auth-field input:focus,
.auth-field select:focus,
.auth-field textarea:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px rgba(22, 163, 74, .10);
}

html[data-theme="dark"] .auth-field input:focus,
html[data-theme="dark"] .auth-field select:focus,
html[data-theme="dark"] .auth-field textarea:focus {
    box-shadow:
        0 0 0 3px rgba(34, 197, 94, .13);
}

.auth-field input::placeholder {
    color: var(--muted);
    opacity: .7;
}


/* ----------------------------------------------------------
   PASSWORD INPUT
---------------------------------------------------------- */

.auth-input-wrap {
    position: relative;

    width: 100%;
}

.auth-input-wrap input {
    padding-right: 44px;
}

.auth-password-toggle {
    position: absolute;

    top: 50%;
    right: 5px;

    width: 32px;
    height: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    transform: translateY(-50%);

    padding: 0;

    border: 0;
    border-radius: 6px;

    background: transparent;
    color: var(--muted);

    cursor: pointer;

    font-size: 13px;
}

.auth-password-toggle:hover {
    background: var(--bg-secondary);
    color: var(--text);
}


/* ----------------------------------------------------------
   LOGIN HELP
---------------------------------------------------------- */

.auth-help {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    margin-top: -1px;

    font-size: 11px;
}

.auth-help a {
    color: var(--primary);

    font-weight: 700;

    text-decoration: none;
}

.auth-help a:hover {
    text-decoration: underline;
}

.auth-help .muted {
    color: var(--muted);
}


/* ----------------------------------------------------------
   PRIMARY SUBMIT
---------------------------------------------------------- */

.auth-submit {
    width: 100%;

    min-height: 43px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-top: 4px;

    border: 0;
    border-radius: 8px;

    background: var(--primary);
    color: #fff;

    font-family: inherit;
    font-size: 13px;
    font-weight: 700;

    cursor: pointer;

    box-shadow:
        0 3px 8px rgba(22, 163, 74, .16);

    transition:
        background var(--transition),
        transform var(--transition),
        box-shadow var(--transition);
}

.auth-submit:hover {
    background: var(--primary-dark);

    transform: translateY(-1px);

    box-shadow:
        0 5px 12px rgba(22, 163, 74, .20);
}

.auth-submit:active {
    transform: translateY(0);
}

.auth-submit:disabled {
    opacity: .65;

    cursor: not-allowed;

    transform: none;
}


/* ----------------------------------------------------------
   REGISTRATION FORM
---------------------------------------------------------- */

.auth-register-form {
    width: 100%;

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 14px;

    margin: 0;
    padding: 0;
}

.auth-register-form .full {
    grid-column: 1 / -1;
}


/* ----------------------------------------------------------
   REGISTRATION NOTE
---------------------------------------------------------- */

.auth-register-note {
    padding: 10px 12px;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--bg-secondary);
    color: var(--muted);

    font-size: 11px;
    line-height: 1.5;
}


/* ----------------------------------------------------------
   LOGIN / REGISTER SWITCH
---------------------------------------------------------- */

.auth-switch {
    margin-top: 20px;

    text-align: center;

    color: var(--muted);

    font-size: 12px;
    line-height: 1.5;
}

.auth-switch a {
    color: var(--primary);

    font-weight: 700;

    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}


/* ==========================================================
   TABLET
========================================================== */

@media (max-width: 800px) {

    .auth-page {
        padding: 18px;
    }

    .auth-shell {
        max-width: 620px;

        grid-template-columns: 1fr;

        min-height: auto;
    }

    .auth-brand-panel {
        min-height: 250px;

        padding: 32px;
    }

    .auth-brand-logo {
        margin-bottom: 30px;
    }

    .auth-brand-content h1 {
        font-size: 36px;
    }

    .auth-feature-list {
        display: grid;

        grid-template-columns: 1fr 1fr;

        gap: 8px 18px;

        margin-top: 20px;
    }

    .auth-brand-footer {
        display: none;
    }

    .auth-form-panel {
        min-height: auto;
    }

    .auth-form-content {
        max-width: 480px;

        margin: 0 auto;

        padding: 30px 34px 38px;
    }
}


/* ==========================================================
   MOBILE
========================================================== */

@media (max-width: 560px) {

    .auth-page {
        min-height: 100vh;

        display: block;

        padding: 0;
    }

    .auth-shell {
        width: 100%;
        max-width: none;

        min-height: 100vh;

        display: block;

        border: 0;
        border-radius: 0;

        box-shadow: none;
    }

    .auth-brand-panel {
        min-height: auto;

        padding: 26px 22px 28px;
    }

    .auth-brand-logo {
        margin-bottom: 25px;
    }

    .auth-brand-content h1 {
        font-size: 32px;
    }

    .auth-brand-description {
        font-size: 13px;
    }

    .auth-feature-list {
        display: none;
    }

    .auth-form-panel {
        min-height: auto;
    }

    .auth-form-top {
        padding: 14px 18px 0;
    }

    .auth-form-content {
        width: 100%;
        max-width: none;

        margin: 0;

        padding: 22px 22px 32px;
    }

    .auth-heading {
        margin-bottom: 18px;
    }

    .auth-heading h2 {
        font-size: 23px;
    }

    .auth-register-form {
        grid-template-columns: 1fr;
    }

    .auth-register-form .full {
        grid-column: auto;
    }

    .auth-help {
        font-size: 10px;
    }
}


/* ==========================================================
   PAYMENT OPTIONS
========================================================== */

.payment-options-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}


.payment-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;

    width: 100%;
    padding: 10px;

    border: 1px solid var(--border-color, #ddd);
    border-radius: 10px;

    background: var(--card-bg, #fff);
    color: inherit;

    cursor: pointer;

    transition:
        transform .15s ease,
        border-color .15s ease,
        box-shadow .15s ease;
}


.payment-option:hover {
    transform: translateY(-2px);
    border-color: var(--primary, #16a34a);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
}


.payment-option img {
    display: block;

    width: 100%;
    max-width: 130px;
    aspect-ratio: 1 / 1;

    object-fit: contain;

    border-radius: 7px;
}


.payment-option span {
    font-size: 12px;
    font-weight: 700;
}


/* ==========================================================
   PAYMENT QR MODAL
========================================================== */

.payment-qr-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;
}


.payment-qr-modal[hidden] {
    display: none;
}


.payment-qr-overlay {
    position: absolute;
    inset: 0;

    background: rgba(0, 0, 0, .72);
}


.payment-qr-dialog {
    position: relative;
    z-index: 1;

    width: min(440px, 100%);
    max-height: calc(100vh - 40px);

    overflow: auto;

    border-radius: 14px;

    background: var(--card-bg, #fff);
    color: var(--text-color, #111);

    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}


.payment-qr-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 15px;

    padding: 15px 17px;

    border-bottom: 1px solid var(--border-color, #ddd);
}


.payment-qr-header h3 {
    margin: 0;
    font-size: 16px;
}


.payment-qr-header p {
    margin: 3px 0 0;
    font-size: 11px;
}


.payment-qr-close {
    width: 30px;
    height: 30px;

    border: 0;
    border-radius: 7px;

    background: transparent;
    color: inherit;

    font-size: 22px;
    line-height: 1;

    cursor: pointer;
}


.payment-qr-close:hover {
    background: rgba(127, 127, 127, .12);
}


.payment-qr-body {
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 18px;
}


.payment-qr-body img {
    display: block;

    width: min(360px, 100%);
    max-height: 55vh;

    object-fit: contain;

    border-radius: 8px;
}


.payment-qr-footer {
    display: flex;
    justify-content: flex-end;
    gap: 7px;

    padding: 12px 17px;

    border-top: 1px solid var(--border-color, #ddd);
}


.payment-qr-footer .btn-primary,
.payment-qr-footer .btn-secondary {
    text-decoration: none;
}


/* ==========================================================
   MOBILE
========================================================== */

@media (max-width: 700px) {

    .payment-options-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}


@media (max-width: 420px) {

    .payment-options-grid {
        gap: 7px;
    }

    .payment-option {
        padding: 7px;
    }

    .payment-option img {
        max-width: 105px;
    }

    .payment-qr-modal {
        padding: 10px;
    }

    .payment-qr-dialog {
        max-height: calc(100vh - 20px);
    }

    .payment-qr-footer {
        flex-direction: column;
    }

    .payment-qr-footer .btn-primary,
    .payment-qr-footer .btn-secondary {
        width: 100%;
        text-align: center;
    }

}








/* ==========================================================
TODO:    BACK TO HOME
========================================================== */

.auth-back-home {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    min-height: 34px;
    padding: 0 10px;

    border: 1px solid var(--border-color, #ddd);
    border-radius: 7px;

    background: transparent;
    color: inherit;

    font-size: 12px;
    font-weight: 700;

    text-decoration: none;

    transition:
        background .15s ease,
        border-color .15s ease,
        transform .15s ease;
}


.auth-back-home:hover {
    background: rgba(127, 127, 127, .08);
    border-color: var(--primary, #16a34a);

    transform: translateX(-1px);
}


.auth-back-home-icon {
    font-size: 15px;
    line-height: 1;
}





/* ==========================================================
  TODO: REGISTRATION PASSWORD REQUIREMENTS
========================================================== */

.password-requirements {
    padding: 12px 14px;
    margin-top: -4px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--muted);
    font-size: .8rem;
    line-height: 1.7;
}


.password-requirements-title {
    margin-bottom: 4px;
    color: var(--text);
    font-weight: 700;
}


.password-requirements [data-password-rule] {
    transition:
        color .15s ease;
}


.password-requirements
[data-password-rule].valid {
    color: var(--success-text, #16a34a);
    font-weight: 600;
}


/* ==========================================================
 TODO:  PASSWORD INPUT WITH VIEW BUTTON
========================================================== */

.password-input-wrapper {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
}

.password-input-wrapper input {
    display: block;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding-right: 48px;
}

.password-visibility-toggle {
    position: absolute;
    top: 50%;
    right: 8px;

    width: 32px;
    height: 32px;

    margin: 0;
    padding: 0;

    transform: translateY(-50%);

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 7px;

    background: transparent;
    color: var(--muted);

    cursor: pointer;

    font-family: inherit;
    font-size: 16px;
    line-height: 1;

    box-sizing: border-box;

    z-index: 2;
}

.password-visibility-toggle:hover {
    background: var(--card-hover);
    color: var(--primary);
}

.password-visibility-toggle:focus {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.password-visibility-toggle:active {
    transform: translateY(-50%) scale(.96);
}



/* ==========================================================
  TODO: SWEETALERT FORGOT PASSWORD EMAIL INPUT
========================================================== */

.swal2-popup .swal2-input {
    width: calc(100% - 40px);
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.swal2-popup .swal2-input[type="email"] {
    width: calc(100% - 40px);
    max-width: 100%;
}

/* Mobile */
@media (max-width: 480px) {

    .swal2-popup {
        width: calc(100% - 24px) !important;
        box-sizing: border-box;
    }
    
    .swal2-popup .swal2-input {
        width: calc(100% - 24px);
        margin-left: auto;
        margin-right: auto;
    }

}
    

    /* ==========================================================
      TODO: FORGOT PASSWORD
    ========================================================== */
.auth-forgot-password {
    margin-top: -8px;
    margin-bottom: 16px;
    text-align: right;
}

.auth-forgot-password a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.auth-forgot-password a:hover {
    text-decoration: underline;
}