/* =========================================================
   A1 CASH & CARRY
   LOGIN + REGISTER AUTHENTICATION CSS
========================================================= */


/* =========================================================
   ROOT
========================================================= */

:root {
    --auth-green: #16a34a;
    --auth-dark-green: #15803d;
    --auth-light-green: #22c55e;
    --auth-soft-green: #f0fdf4;

    --auth-dark: #111827;
    --auth-text: #1f2937;
    --auth-muted: #6b7280;

    --auth-border: #e5e7eb;
    --auth-input-bg: #ffffff;

    --auth-white: #ffffff;

    --auth-danger: #dc2626;
    --auth-success: #16a34a;

    --auth-shadow:
        0 20px 60px rgba(0, 0, 0, 0.12);
}


/* =========================================================
   BODY
========================================================= */

.auth-body {
    margin: 0;
    padding: 0;

    min-height: 100vh;

    font-family:
        "Inter",
        "Segoe UI",
        Arial,
        sans-serif;

    background: #f8fafc;

    color: var(--auth-text);

    overflow-x: hidden;
}


/* =========================================================
   MAIN AUTH PAGE
========================================================= */

.auth-page {
    min-height: 100vh;

    display: grid;

    grid-template-columns:
        minmax(420px, 1fr)
        minmax(500px, 620px);

    background: var(--auth-white);
}


/* =========================================================
   LEFT SIDE
========================================================= */

.auth-left {
    position: relative;

    min-height: 100vh;

    display: flex;
    align-items: center;

    padding: 55px;

    overflow: hidden;

    background-image:
        url("../assets/images/banners/a1-banner.jpg");

    background-size: cover;

    background-position: center;

    background-repeat: no-repeat;
}


/* DARK/GREEN OVERLAY */

.auth-left-overlay {
    position: absolute;

    inset: 0;

    background:
        linear-gradient(
            135deg,
            rgba(4, 55, 32, 0.94),
            rgba(21, 128, 61, 0.82),
            rgba(0, 0, 0, 0.48)
        );

    z-index: 1;
}


/* =========================================================
   LEFT CONTENT
========================================================= */

.auth-brand-content {
    position: relative;

    z-index: 2;

    width: 100%;

    max-width: 620px;

    margin: auto;

    color: white;
}


/* =========================================================
   AUTH LOGO
========================================================= */

.auth-logo {
    display: inline-flex;

    align-items: center;

    gap: 13px;

    text-decoration: none;

    color: white;

    margin-bottom: 75px;
}


.auth-logo-icon {
    width: 52px;
    height: 52px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 14px;

    background: white;

    color: var(--auth-green);

    font-size: 22px;

    font-weight: 900;

    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.18);
}


.auth-logo-text {
    display: flex;

    flex-direction: column;

    gap: 2px;
}


.auth-logo-text strong {
    font-size: 21px;

    font-weight: 800;

    letter-spacing: -0.3px;
}


.auth-logo-text span {
    font-size: 12px;

    opacity: 0.78;

    letter-spacing: 0.7px;
}


/* =========================================================
   WELCOME CONTENT
========================================================= */

.auth-welcome {
    max-width: 560px;
}


.auth-small-title {
    display: inline-block;

    margin-bottom: 18px;

    font-size: 12px;

    font-weight: 800;

    letter-spacing: 2px;

    color: #bbf7d0;
}


.auth-welcome h1 {
    margin: 0 0 22px;

    font-size: clamp(42px, 4vw, 68px);

    line-height: 1.04;

    font-weight: 900;

    letter-spacing: -2px;

    color: white;
}


.auth-welcome p {
    max-width: 540px;

    margin: 0;

    font-size: 16px;

    line-height: 1.8;

    color: rgba(255, 255, 255, 0.84);
}


/* =========================================================
   FEATURES
========================================================= */

.auth-features {
    display: flex;

    flex-direction: column;

    gap: 22px;

    margin-top: 45px;
}


.auth-feature {
    display: flex;

    align-items: center;

    gap: 15px;
}


.feature-icon {
    width: 45px;
    height: 45px;

    flex-shrink: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background:
        rgba(255, 255, 255, 0.14);

    border:
        1px solid rgba(255, 255, 255, 0.18);

    color: #dcfce7;

    font-size: 17px;
}


.auth-feature div:last-child {
    display: flex;

    flex-direction: column;

    gap: 3px;
}


.auth-feature strong {
    font-size: 14px;

    color: white;
}


.auth-feature span {
    font-size: 12px;

    color:
        rgba(255, 255, 255, 0.67);
}


/* =========================================================
   RIGHT SIDE
========================================================= */

.auth-right {
    position: relative;

    min-height: 100vh;

    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: center;

    padding: 80px 55px 35px;

    background: #ffffff;

    overflow-y: auto;
}


/* =========================================================
   BACK HOME
========================================================= */

.back-home {
    position: absolute;

    top: 28px;
    left: 40px;

    display: inline-flex;

    align-items: center;

    gap: 8px;

    color: var(--auth-muted);

    text-decoration: none;

    font-size: 13px;

    font-weight: 600;

    transition: 0.25s ease;
}


.back-home:hover {
    color: var(--auth-green);

    transform: translateX(-3px);
}


/* =========================================================
   AUTH CARD
========================================================= */

.auth-card {
    width: 100%;

    max-width: 475px;

    padding: 20px 0;
}


.register-card {
    max-width: 500px;
}


/* =========================================================
   CARD HEADER
========================================================= */

.auth-card-header {
    margin-bottom: 30px;
}


.auth-card-small {
    display: block;

    margin-bottom: 8px;

    font-size: 11px;

    font-weight: 800;

    letter-spacing: 1.8px;

    color: var(--auth-green);
}


.auth-card-header h2 {
    margin: 0 0 9px;

    font-size: 34px;

    line-height: 1.15;

    font-weight: 800;

    letter-spacing: -1px;

    color: var(--auth-dark);
}


.auth-card-header p {
    margin: 0;

    color: var(--auth-muted);

    font-size: 14px;

    line-height: 1.6;
}


/* =========================================================
   MOBILE LOGO
========================================================= */

.mobile-auth-logo {
    display: none;

    width: 48px;
    height: 48px;

    align-items: center;
    justify-content: center;

    margin-bottom: 18px;

    border-radius: 13px;

    background: var(--auth-green);

    color: white;

    font-size: 20px;

    font-weight: 900;
}


/* =========================================================
   FORM
========================================================= */

.auth-form {
    width: 100%;
}


.form-group {
    margin-bottom: 19px;
}


.form-group label {
    display: block;

    margin-bottom: 8px;

    font-size: 13px;

    font-weight: 700;

    color: var(--auth-text);
}


/* =========================================================
   PASSWORD LABEL
========================================================= */

.password-label-row {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 10px;
}


.password-label-row label {
    margin-bottom: 8px;
}


.forgot-link {
    margin-bottom: 8px;

    font-size: 12px;

    font-weight: 600;

    color: var(--auth-green);

    text-decoration: none;

    transition: 0.2s ease;
}


.forgot-link:hover {
    color: var(--auth-dark-green);

    text-decoration: underline;
}


/* =========================================================
   INPUT WRAPPER
========================================================= */

.input-wrapper {
    position: relative;

    width: 100%;
}


.input-icon {
    position: absolute;

    left: 16px;

    top: 50%;

    transform: translateY(-50%);

    color: #9ca3af;

    font-size: 14px;

    pointer-events: none;

    transition: 0.2s ease;
}


.input-wrapper input {
    width: 100%;

    height: 52px;

    box-sizing: border-box;

    padding:
        0 48px
        0 45px;

    border:
        1px solid var(--auth-border);

    border-radius: 11px;

    outline: none;

    background: var(--auth-input-bg);

    color: var(--auth-text);

    font-family: inherit;

    font-size: 14px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}


.input-wrapper input::placeholder {
    color: #a1a1aa;
}


.input-wrapper input:hover {
    border-color: #cbd5e1;
}


.input-wrapper input:focus {
    border-color: var(--auth-green);

    box-shadow:
        0 0 0 4px rgba(22, 163, 74, 0.09);
}


.input-wrapper:focus-within .input-icon {
    color: var(--auth-green);
}


/* =========================================================
   PASSWORD TOGGLE
========================================================= */

.password-toggle {
    position: absolute;

    top: 50%;
    right: 13px;

    transform: translateY(-50%);

    width: 34px;
    height: 34px;

    display: flex;

    align-items: center;
    justify-content: center;

    border: none;

    background: transparent;

    color: #9ca3af;

    cursor: pointer;

    border-radius: 7px;

    transition: 0.2s ease;
}


.password-toggle:hover {
    background: #f3f4f6;

    color: var(--auth-green);
}


/* =========================================================
   FORM ERROR
========================================================= */

.form-error {
    display: block;

    min-height: 0;

    margin-top: 5px;

    color: var(--auth-danger);

    font-size: 11px;

    line-height: 1.4;
}


.input-error {
    border-color:
        var(--auth-danger) !important;

    box-shadow:
        0 0 0 3px rgba(220, 38, 38, 0.08) !important;
}


/* =========================================================
   REMEMBER ME
========================================================= */

.remember-row {
    margin: 2px 0 20px;
}


.remember-checkbox,
.terms-checkbox {
    position: relative;

    display: flex;

    align-items: flex-start;

    gap: 9px;

    cursor: pointer;

    color: var(--auth-muted);

    font-size: 12px;

    line-height: 1.5;
}


.remember-checkbox input,
.terms-checkbox input {
    position: absolute;

    opacity: 0;

    pointer-events: none;
}


.custom-checkbox {
    width: 17px;
    height: 17px;

    flex-shrink: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    margin-top: 1px;

    border:
        1px solid #d1d5db;

    border-radius: 5px;

    background: white;

    color: white;

    font-size: 9px;

    transition: 0.2s ease;
}


.remember-checkbox input:checked
~ .custom-checkbox,

.terms-checkbox input:checked
~ .custom-checkbox {
    border-color: var(--auth-green);

    background: var(--auth-green);
}


.custom-checkbox i {
    opacity: 0;

    transform: scale(0.5);

    transition: 0.15s ease;
}


.remember-checkbox input:checked
~ .custom-checkbox i,

.terms-checkbox input:checked
~ .custom-checkbox i {
    opacity: 1;

    transform: scale(1);
}


/* =========================================================
   TERMS
========================================================= */

.terms-row {
    margin-top: 3px;
}


.terms-checkbox a {
    color: var(--auth-green);

    font-weight: 600;

    text-decoration: none;
}


.terms-checkbox a:hover {
    text-decoration: underline;
}


#termsError {
    margin-top: 5px;

    margin-left: 26px;
}


/* =========================================================
   PASSWORD STRENGTH
========================================================= */

.password-strength {
    display: none;

    margin-top: 9px;
}


.password-strength.show {
    display: block;
}


.strength-bar {
    width: 100%;
    height: 4px;

    overflow: hidden;

    border-radius: 20px;

    background: #e5e7eb;
}


.strength-bar span {
    display: block;

    width: 0;

    height: 100%;

    border-radius: inherit;

    background: var(--auth-green);

    transition:
        width 0.3s ease,
        background 0.3s ease;
}


.password-strength small {
    display: block;

    margin-top: 5px;

    color: var(--auth-muted);

    font-size: 10px;
}


/* =========================================================
   AUTH MESSAGE
========================================================= */

.auth-message {
    display: none;

    padding: 11px 13px;

    margin-bottom: 15px;

    border-radius: 9px;

    font-size: 12px;

    line-height: 1.5;
}


.auth-message.show {
    display: block;
}


.auth-message.error {
    background: #fef2f2;

    color: #b91c1c;

    border:
        1px solid #fecaca;
}


.auth-message.success {
    background: #f0fdf4;

    color: #15803d;

    border:
        1px solid #bbf7d0;
}


/* =========================================================
   SUBMIT BUTTON
========================================================= */

.auth-submit-btn {
    width: 100%;

    height: 53px;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 10px;

    border: none;

    border-radius: 11px;

    background:
        linear-gradient(
            135deg,
            #d31010,
            #e80707
        );

    color: white;

    font-family: inherit;

    font-size: 14px;

    font-weight: 700;

    cursor: pointer;

    box-shadow:
        0 8px 20px rgba(22, 163, 74, 0.20);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        opacity 0.2s ease;
}


.auth-submit-btn:hover {
    transform: translateY(-2px);

    box-shadow:
        0 12px 25px rgba(22, 163, 74, 0.28);
}


.auth-submit-btn:active {
    transform: translateY(0);
}


.auth-submit-btn:disabled {
    opacity: 0.7;

    cursor: not-allowed;

    transform: none;
}


/* =========================================================
   DIVIDER
========================================================= */

.auth-divider {
    display: flex;

    align-items: center;

    gap: 12px;

    margin: 25px 0 18px;
}


.auth-divider span {
    flex: 1;

    height: 1px;

    background: #e5e7eb;
}


.auth-divider p {
    margin: 0;

    white-space: nowrap;

    color: #9ca3af;

    font-size: 9px;

    font-weight: 700;

    letter-spacing: 0.8px;
}


/* =========================================================
   SOCIAL LOGIN
========================================================= */

.social-login {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 11px;
}


.social-btn {
    height: 48px;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 9px;

    border:
        1px solid var(--auth-border);

    border-radius: 10px;

    background: white;

    color: var(--auth-text);

    font-family: inherit;

    font-size: 13px;

    font-weight: 600;

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}


.social-btn:hover {
    background: #f9fafb;

    border-color: #cbd5e1;

    transform: translateY(-1px);
}


.google-btn i {
    color: #db4437;

    font-size: 16px;
}


.facebook-btn i {
    color: #1877f2;

    font-size: 16px;
}


/* =========================================================
   SWITCH LOGIN / REGISTER
========================================================= */

.auth-switch {
    margin-top: 25px;

    text-align: center;
}


.auth-switch p {
    margin: 0;

    color: var(--auth-muted);

    font-size: 13px;
}


.auth-switch a {
    color: var(--auth-green);

    font-weight: 700;

    text-decoration: none;

    margin-left: 3px;
}


.auth-switch a:hover {
    text-decoration: underline;

    color: var(--auth-dark-green);
}


/* =========================================================
   FOOTER
========================================================= */

.auth-footer {
    width: 100%;

    max-width: 500px;

    margin-top: 30px;

    padding-top: 18px;

    border-top:
        1px solid #f0f0f0;

    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 15px;
}


.auth-footer p {
    margin: 0;

    color: #9ca3af;

    font-size: 10px;
}


.auth-footer div {
    display: flex;

    align-items: center;

    gap: 7px;
}


.auth-footer a {
    color: #9ca3af;

    font-size: 10px;

    text-decoration: none;
}


.auth-footer a:hover {
    color: var(--auth-green);
}


.auth-footer span {
    color: #d1d5db;

    font-size: 9px;
}


/* =========================================================
   LOADING STATE
========================================================= */

.auth-submit-btn.loading {
    pointer-events: none;

    opacity: 0.8;
}


.auth-submit-btn.loading i {
    animation:
        authSpin 0.8s linear infinite;
}


@keyframes authSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}


/* =========================================================
   DARK MODE SUPPORT
========================================================= */

body.dark-mode .auth-body,
.dark-mode .auth-body {
    background: #0f172a;
}


body.dark-mode .auth-right,
.dark-mode .auth-right {
    background: #111827;
}


body.dark-mode .auth-card-header h2,
.dark-mode .auth-card-header h2,
body.dark-mode .form-group label,
.dark-mode .form-group label {
    color: #f9fafb;
}


body.dark-mode .auth-card-header p,
.dark-mode .auth-card-header p {
    color: #9ca3af;
}


body.dark-mode .input-wrapper input,
.dark-mode .input-wrapper input {
    background: #1f2937;

    border-color: #374151;

    color: #f9fafb;
}


body.dark-mode .input-wrapper input::placeholder,
.dark-mode .input-wrapper input::placeholder {
    color: #6b7280;
}


body.dark-mode .social-btn,
.dark-mode .social-btn {
    background: #1f2937;

    border-color: #374151;

    color: #f9fafb;
}


body.dark-mode .social-btn:hover,
.dark-mode .social-btn:hover {
    background: #273449;
}


body.dark-mode .auth-footer,
.dark-mode .auth-footer {
    border-color: #273449;
}


body.dark-mode .custom-checkbox,
.dark-mode .custom-checkbox {
    background: #1f2937;

    border-color: #4b5563;
}


body.dark-mode .password-toggle:hover,
.dark-mode .password-toggle:hover {
    background: #273449;
}


/* =========================================================
   LARGE DESKTOP
========================================================= */

@media (min-width: 1500px) {

    .auth-left {
        padding-left: 8vw;
        padding-right: 8vw;
    }

    .auth-right {
        padding-left: 80px;
        padding-right: 80px;
    }

}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1100px) {

    .auth-page {
        grid-template-columns:
            42% 58%;
    }


    .auth-left {
        padding: 35px;
    }


    .auth-right {
        padding-left: 35px;
        padding-right: 35px;
    }


    .auth-logo {
        margin-bottom: 50px;
    }


    .auth-welcome h1 {
        font-size: 45px;
    }


    .auth-welcome p {
        font-size: 14px;
    }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 800px) {

    .auth-page {
        display: block;

        min-height: 100vh;
    }


    /* Hide left desktop panel */

    .auth-left {
        display: none;
    }


    /* Right becomes full page */

    .auth-right {
        min-height: 100vh;

        padding:
            75px
            25px
            30px;
    }


    .back-home {
        top: 25px;

        left: 25px;
    }


    .mobile-auth-logo {
        display: flex;
    }


    .auth-card {
        max-width: 500px;

        padding: 10px 0;
    }


    .auth-card-header h2 {
        font-size: 30px;
    }


    .auth-footer {
        max-width: 500px;

        flex-direction: column;

        justify-content: center;

        text-align: center;

        gap: 8px;
    }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 480px) {

    .auth-right {
        padding:
            72px
            18px
            25px;
    }


    .back-home {
        left: 18px;

        top: 23px;

        font-size: 12px;
    }


    .auth-card-header {
        margin-bottom: 25px;
    }


    .auth-card-header h2 {
        font-size: 27px;
    }


    .auth-card-header p {
        font-size: 13px;
    }


    .input-wrapper input {
        height: 50px;

        font-size: 13px;
    }


    .auth-submit-btn {
        height: 51px;

        font-size: 13px;
    }


    .social-login {
        grid-template-columns: 1fr;
    }


    .social-btn {
        height: 46px;
    }


    .auth-footer div {
        flex-wrap: wrap;

        justify-content: center;
    }

}


/* =========================================================
   EXTRA SMALL
========================================================= */

@media (max-width: 350px) {

    .auth-right {
        padding-left: 14px;
        padding-right: 14px;
    }


    .auth-card-header h2 {
        font-size: 24px;
    }


    .password-label-row {
        align-items: flex-start;

        flex-direction: column;

        gap: 0;
    }


    .forgot-link {
        margin-top: -2px;
    }

}