/*
 * iRestora PLUS - Auth pages redesign
 * Split-screen modern layout. Loaded AFTER login_new.css and only overrides
 * what it needs to; existing login.js / pin-login JS keeps working.
 */

/* -------- Brand colors (matches login_new.css #7367f0) ---------------------- */
:root {
    --auth-purple-700: #5B2FC9;
    --auth-purple-600: #5E3DD8;
    --auth-purple-500: #7367f0;
    --auth-purple-400: #9f97f9;
    --auth-purple-100: #EEEBFD;
    --auth-ink:        #2A2540;
    --auth-ink-soft:   #6B6788;
    --auth-bg:         #F5F4FB;
    --auth-success:    #28C76F;
}

/* -------- Reset container styles from login_new.css ------------------------- */
body {
    margin: 0;
    min-height: 100vh;
    background: var(--auth-bg);
    color: var(--auth-ink);
    font-family: 'Roboto', 'Segoe UI', sans-serif;
}
body > .container,
body > .container > .row {
    margin: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

/* -------- Wrapper: split layout -------------------------------------------- */
.auth-wrapper {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
    width: 100%;
}
.auth-left {
    flex: 0 0 40%;
    max-width: 40%;
    background:
        radial-gradient(circle at 20% 15%, rgba(255,255,255,0.12) 0, transparent 35%),
        radial-gradient(circle at 85% 80%, rgba(255,255,255,0.08) 0, transparent 40%),
        linear-gradient(135deg, var(--auth-purple-700) 0%, var(--auth-purple-500) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    position: relative;
    overflow: hidden;
}
.auth-left::before {
    content: '';
    position: absolute;
    left: -120px; bottom: -120px;
    width: 360px; height: 360px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}
.auth-left::after {
    content: '';
    position: absolute;
    right: -80px; top: -80px;
    width: 240px; height: 240px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}
.auth-left-inner {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 360px;
}
.auth-left .pen-title {
    padding: 0;
    margin-bottom: 28px;
}
.auth-left .pen-title img {
    max-height: 72px;
    width: auto;
    background: rgba(255,255,255,0.95);
    padding: 12px 18px;
    border-radius: 14px;
    box-shadow: 0 12px 36px rgba(0,0,0,0.18);
}
.auth-left h1 {
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 12px;
    letter-spacing: 0.5px;
}
.auth-left p.tagline {
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
    opacity: 0.88;
}
.auth-left .version-stamp {
    position: absolute;
    bottom: 24px;
    left: 0; right: 0;
    text-align: center;
    font-size: 12px;
    opacity: 0.7;
    letter-spacing: 1px;
}

.auth-right {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    position: relative;
}
.auth-card {
    width: 100%;
    max-width: 420px;
}

/* -------- Right-panel titles + progress ----------------------------------- */
.auth-heading {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 700;
    color: var(--auth-ink);
    letter-spacing: 0.2px;
}
.auth-subheading {
    margin: 0 0 28px;
    color: var(--auth-ink-soft);
    font-size: 15px;
}
.auth-progress {
    display: flex;
    gap: 10px;
    margin: 0 0 28px;
    padding: 0;
    list-style: none;
}
.auth-progress li {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #E5E2F1;
    position: relative;
}
.auth-progress li .label {
    position: absolute;
    bottom: -22px;
    left: 0; right: 0;
    text-align: center;
    font-size: 11px;
    color: var(--auth-ink-soft);
    letter-spacing: 0.5px;
}
.auth-progress li.done { background: var(--auth-success); }
.auth-progress li.active {
    background: linear-gradient(90deg, var(--auth-purple-500) 0%, var(--auth-purple-400) 100%);
}
.auth-progress li.active .label,
.auth-progress li.done .label {
    color: var(--auth-purple-600);
    font-weight: 600;
}

/* -------- Override .card to remove old card-with-circle look ---------------- */
.card {
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}
.card:first-child {
    display: none !important;
}
.card .title {
    display: none !important;       /* heading moved above form */
}
.card .input-container {
    margin: 0 0 22px !important;
}
.card .input-container.custom_margin {
    margin: 0 0 22px !important;
}
.card .input-container input {
    height: 52px !important;
    font-size: 15px !important;
    padding: 4px 0 4px 0 !important;
}
.card .input-container label {
    font-size: 15px !important;
    font-weight: 400;
    color: var(--auth-ink-soft) !important;
    line-height: 52px !important;
    transition: 0.2s ease !important;
}
.card .input-container input:focus ~ label,
.card .input-container input:valid ~ label {
    color: var(--auth-purple-600) !important;
    transform: translate(0, -22px) scale(0.85) !important;
}
.card .input-container .bar {
    background: #E5E2F1 !important;
    height: 2px !important;
}
.card .input-container .bar:before,
.card .input-container .bar:after {
    background: var(--auth-purple-500) !important;
}
.card .button-container {
    margin: 8px 0 16px !important;
}
.card .button-container button {
    background: linear-gradient(135deg, var(--auth-purple-600) 0%, var(--auth-purple-500) 100%) !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 16px 24px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px;
    box-shadow: 0 6px 18px rgba(115,103,240,0.35);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.card .button-container button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(115,103,240,0.45);
}
.card .button-container button:active,
.card .button-container button:focus {
    outline: none;
}
.card .button-container button span {
    color: #fff !important;
}
.card .footer {
    margin: 18px 0 0 !important;
    text-align: center !important;
    font-size: 14px !important;
    color: var(--auth-ink-soft) !important;
}
.card .footer a {
    color: var(--auth-purple-600) !important;
    font-weight: 600;
}

/* Hidden alt register card: clean toggle, no oversized purple circle */
.card.alt {
    display: none !important;
}

/* -------- Flash messages --------------------------------------------------- */
.auth-flash {
    border-radius: 10px;
    padding: 12px 16px;
    margin: 0 0 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
}
.auth-flash.error {
    background: #FDECEE;
    color: #B3304B;
    border-color: #F5C9D2;
}
.auth-flash.success {
    background: #E6F8EE;
    color: #1F8A52;
    border-color: #BFE6CF;
}
.auth-flash i { font-size: 16px; }

/* -------- PIN / Username toggle ------------------------------------------- */
.btn_login_pin_table {
    background: var(--auth-purple-100);
    border-radius: 10px;
    padding: 4px;
    margin: 0 0 24px !important;
    width: 100%;
    display: flex;
    border-collapse: separate;
    border-spacing: 0;
}
.btn_login_pin_table tr { display: flex; width: 100%; }
.btn_login_pin_table td {
    display: flex; flex: 1; padding: 0;
}
.btn_login_pin_table a {
    flex: 1;
    text-align: center;
    padding: 10px 14px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    border: none !important;
    background: transparent !important;
    color: var(--auth-ink-soft) !important;
    transition: all 0.15s ease;
}
.btn_login_pin_table a.active_login_btn {
    background: #fff !important;
    color: var(--auth-purple-600) !important;
    box-shadow: 0 2px 6px rgba(115,103,240,0.18);
}
.btn_login_pin_table a:hover { text-decoration: none !important; }

/* PIN widget centering */
.div_1#loginpin { margin: 8px 0 18px; }
.div_1 .pinlogin-input-box {
    border: 2px solid #E5E2F1;
    border-radius: 10px;
    background: #fff;
}
.div_1 .pinlogin-input-box.active { border-color: var(--auth-purple-500); }

/* -------- Demo buttons ----------------------------------------------------- */
.demo-buttons {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px dashed #E5E2F1;
    text-align: center;
}
.demo-buttons .demo-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--auth-ink-soft);
    margin-bottom: 12px;
}
.demo-buttons .btn_demo {
    background: #fff !important;
    color: var(--auth-purple-600) !important;
    border: 1px solid #E5E2F1 !important;
    border-radius: 8px !important;
    margin: 0 4px 6px !important;
    padding: 6px 14px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: all 0.15s ease;
}
.demo-buttons .btn_demo:hover {
    border-color: var(--auth-purple-500) !important;
    color: #fff !important;
    background: var(--auth-purple-500) !important;
}
.demo-buttons .cta-default-whatsapp {
    margin-top: 14px;
}
.demo-buttons .cta-default-whatsapp .btn {
    background: #25D366 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 8px 16px !important;
    font-size: 13px !important;
    box-shadow: none !important;
}
.cta-demo-link { display: none !important; }

/* -------- Signup link ------------------------------------------------------ */
.div_signup_link { margin-top: 14px !important; }
.div_signup_link_a {
    color: var(--auth-purple-600) !important;
    font-weight: 600;
}

/* -------- Error messages --------------------------------------------------- */
.error_txt {
    color: #B3304B !important;
    font-size: 12px !important;
    margin: 6px 0 0 !important;
}
.red_error, .green_error {
    text-align: left !important;
    background: #FDECEE;
    color: #B3304B;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    margin: 0 0 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.green_error {
    background: #E6F8EE;
    color: #1F8A52;
}
.red_error i, .green_error i { font-size: 16px; }

/* -------- Select2 override ------------------------------------------------- */
.auth-card .select2-container--default .select2-selection--single {
    height: 52px !important;
    border: none !important;
    border-bottom: 2px solid #E5E2F1 !important;
    border-radius: 0 !important;
    padding: 0 !important;
}
.auth-card .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 52px !important;
    padding-left: 0 !important;
    color: var(--auth-ink);
    font-size: 15px;
}
.auth-card .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 52px !important;
}
.auth-card .select2-container--default.select2-container--open .select2-selection--single,
.auth-card .select2-container--default .select2-selection--single:focus {
    border-bottom-color: var(--auth-purple-500) !important;
}

/* -------- Floating footer back-link --------------------------------------- */
.auth-back-link {
    position: absolute;
    top: 24px;
    right: 24px;
    color: var(--auth-ink-soft);
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.auth-back-link:hover { color: var(--auth-purple-600); }

/* -------- Responsive ------------------------------------------------------- */
@media (max-width: 991px) {
    .auth-wrapper { flex-direction: column; min-height: 100vh; }
    .auth-left {
        flex: 0 0 auto;
        max-width: 100%;
        padding: 28px 24px;
    }
    .auth-left h1 { font-size: 24px; margin-bottom: 6px; }
    .auth-left p.tagline { font-size: 13px; }
    .auth-left .pen-title { margin-bottom: 12px; }
    .auth-left .pen-title img { max-height: 48px; padding: 8px 12px; }
    .auth-left::before, .auth-left::after { display: none; }
    .auth-left .version-stamp { display: none; }
    .auth-right { padding: 32px 20px; }
    .auth-card { max-width: 100%; }
    .auth-back-link { position: static; display: inline-flex; margin-bottom: 12px; }
}
@media (max-width: 480px) {
    .auth-progress li .label { font-size: 10px; bottom: -20px; }
    .card .input-container input { font-size: 14px !important; }
    .auth-heading { font-size: 22px; }
}
