﻿
/* =========================================================
   NEXTDRIVEN CLOUD SOLUTIONS - LOGIN V6
   MVC5 | RTL/LTR | Light/Dark | Themes 1-13
   Responsive | Mirrored Panels and Top Controls
   ========================================================= */

/* =========================================================
   01. VARIABLES
   ========================================================= */

:root {
    --nd-login-primary: #17a2b8;
    --nd-login-bg: #f5f7fb;
    --nd-login-surface: #ffffff;
    --nd-login-text: #172b4d;
    --nd-login-muted: #758397;
    --nd-login-border: #e4e9f1;
    --nd-login-input: #ffffff;
    --nd-login-shadow: 0 18px 50px rgba(19,42,72,.08);
    --nd-brand-bg-start: #091d32;
    --nd-brand-bg-middle: #10354c;
    --nd-brand-bg-end: #0b5660;
}

/* =========================================================
   02. RESET
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

    body.nd-login-body {
        margin: 0;
        font-family: "Segoe UI", Tahoma, Arial, sans-serif;
        background: var(--nd-login-bg);
        color: var(--nd-login-text);
        -webkit-font-smoothing: antialiased;
    }

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

/* =========================================================
   03. THEME COLORS
   ========================================================= */

body.theme-1 {
    --nd-login-primary: #4885ed;
}

body.theme-2 {
    --nd-login-primary: #b78961;
}

body.theme-3 {
    --nd-login-primary: #a7e92f;
}

body.theme-4 {
    --nd-login-primary: #6610f2;
}

body.theme-5 {
    --nd-login-primary: #dc3545;
}

body.theme-6 {
    --nd-login-primary: #d84797;
}

body.theme-7 {
    --nd-login-primary: #0b5563;
}

body.theme-8 {
    --nd-login-primary: #fd7e14;
}

body.theme-9 {
    --nd-login-primary: #034336;
}

body.theme-10 {
    --nd-login-primary: #00296b;
}

body.theme-11 {
    --nd-login-primary: #17a2b8;
}

body.theme-12 {
    --nd-login-primary: #8233e6;
}

body.theme-13 {
    --nd-login-primary: #ffba08;
}

/* =========================================================
   04. DARK MODE
   ========================================================= */

html[data-nd-mode="dark"] {
    color-scheme: dark;
    --nd-login-bg: #141922;
    --nd-login-surface: #202735;
    --nd-login-text: #e9edf5;
    --nd-login-muted: #a9b5c6;
    --nd-login-border: #394456;
    --nd-login-input: #252e3d;
    --nd-login-shadow: 0 18px 50px rgba(0,0,0,.18);
}

/* =========================================================
   05. MAIN LAYOUT - RTL / LTR
   Arabic: Branding LEFT, Login RIGHT
   English: Login LEFT, Branding RIGHT
   ========================================================= */

.nd-login-shell {
    display: grid;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    /* Physical grid columns always run left to right */
    direction: ltr;
}

    /* ENGLISH: Login LEFT (57%), Branding RIGHT (43%) */

    .nd-login-shell.nd-login-ltr {
        grid-template-columns: minmax(0,40%) minmax(0,60%);
    }

        .nd-login-shell.nd-login-ltr .nd-login-form-panel {
            grid-column: 1;
            grid-row: 1;
            direction: ltr;
        }

        .nd-login-shell.nd-login-ltr .nd-login-brand-panel {
            grid-column: 2;
            grid-row: 1;
            direction: ltr;
        }

    /* ARABIC: Branding LEFT (43%), Login RIGHT (57%) */

    .nd-login-shell.nd-login-rtl {
        grid-template-columns: minmax(0,60%) minmax(0,40%);
    }

        .nd-login-shell.nd-login-rtl .nd-login-brand-panel {
            grid-column: 1;
            grid-row: 1;
            direction: rtl;
        }

        .nd-login-shell.nd-login-rtl .nd-login-form-panel {
            grid-column: 2;
            grid-row: 1;
            direction: rtl;
        }

/* =========================================================
   06. BRAND PANEL
   ========================================================= */

.nd-login-brand-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    min-width: 0;
    min-height: 0;
    padding: 28px clamp(24px,3vw,48px);
    overflow: hidden;
    background: radial-gradient( circle at 50% 45%, rgba(31,194,195,.09), transparent 65% ), linear-gradient( 150deg, var(--nd-brand-bg-start) 0%, var(--nd-brand-bg-middle) 65%, var(--nd-brand-bg-end) 100% );
    color: #ffffff;
}

/* =========================================================
   07. TOP BRAND IDENTITY
   English: Far RIGHT
   Arabic: Far LEFT
   ========================================================= */

.nd-brand-top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    /* Physical alignment independent of page language */
    direction: ltr;
}

/* English: top identity on far RIGHT */
.nd-login-shell.nd-login-ltr .nd-brand-top {
    justify-content: flex-end;
}

/* Arabic: top identity on far LEFT */
.nd-login-shell.nd-login-rtl .nd-brand-top {
    justify-content: flex-start;
}

.nd-brand-identity {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    /* Keep ND icon before NextDriven name */
    direction: ltr;
}

.nd-brand-symbol {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 12px;
    background: var(--nd-login-primary);
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -.5px;
    box-shadow: 0 6px 18px rgba(0,0,0,.12);
    transition: background-color .2s ease;
}

.nd-brand-name {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

    .nd-brand-name strong {
        color: #ffffff;
        font-size: 20px;
        font-weight: 800;
        line-height: 1.2;
    }

    .nd-brand-name span {
        color: rgba(255,255,255,.7);
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 1.5px;
    }

.nd-brand-product {
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.nd-brand-version {
    color: rgba(255,255,255,.65);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
}

/* =========================================================
   08. BRAND CENTER
   ========================================================= */

.nd-brand-center.nd-brand-modern {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 500px;
    min-width: 0;
    margin: auto;
    padding: 24px 0;
    text-align: center;
}

/* =========================================================
   09. MAIN TRANSPARENT LOGO
   ========================================================= */

.nd-brand-logo-card {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(100%,410px);
    height: 230px;
    padding: 0;
    margin: 0 auto 22px;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.nd-brand-main-logo {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 410px;
    max-height: 230px;
    object-fit: contain;
    object-position: center;
    margin: 0 auto;
    background: transparent;
    border: none;
    box-shadow: none;
}

/* =========================================================
   10. BRAND HERO
   ========================================================= */

.nd-brand-modern h1 {
    max-width: 460px;
    margin: 0 0 12px;
    color: #ffffff;
    font-size: clamp(25px,2.4vw,36px);
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -.4px;
}

.nd-brand-modern p {
    max-width: 420px;
    margin: 0;
    color: #c1d8e4;
    font-size: 14px;
    line-height: 1.8;
}

/* =========================================================
   11. FEATURE CHIPS
   ========================================================= */

.nd-brand-modern .nd-brand-features {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 9px;
    margin-top: 24px;
}

.nd-brand-modern .nd-brand-feature {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 11px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 30px;
    background: rgba(255,255,255,.06);
    color: #e6f6fa;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.nd-feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    border-radius: 50%;
    background: rgba(44,210,190,.17);
    color: #76eee0;
    font-size: 11px;
}

/* =========================================================
   12. BRAND FOOTER
   ========================================================= */

.nd-brand-bottom {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    color: rgba(255,255,255,.55);
    font-size: 11px;
}

/* =========================================================
   13. FORM PANEL
   ========================================================= */

.nd-login-form-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--nd-login-bg);
}

/* =========================================================
   14. TOOLBAR
   English: Far LEFT
   Arabic: Far RIGHT
   ========================================================= */

.nd-login-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 32px;
    /* Physical positioning is independent of RTL */
    direction: ltr;
}

/* English: language and appearance on far LEFT */
.nd-login-shell.nd-login-ltr .nd-login-toolbar {
    justify-content: flex-start;
}

/* Arabic: language and appearance on far RIGHT */
.nd-login-shell.nd-login-rtl .nd-login-toolbar {
    justify-content: flex-end;
}

.nd-language-switch {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 4px;
    border: 1px solid var(--nd-login-border);
    border-radius: 11px;
    background: var(--nd-login-surface);
}

.nd-language-button {
    min-width: 45px;
    min-height: 32px;
    padding: 5px 9px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--nd-login-muted);
    font-size: 12px;
    font-weight: 700;
}

    .nd-language-button.active {
        background: var(--nd-login-primary);
        color: #ffffff;
    }

/* =========================================================
   15. APPEARANCE CONTROL
   ========================================================= */

.nd-appearance-control {
    position: relative;
}

.nd-toolbar-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 43px;
    height: 43px;
    border: 1px solid var(--nd-login-border);
    border-radius: 11px;
    background: var(--nd-login-surface);
    color: var(--nd-login-text);
    font-size: 21px;
}

.nd-appearance-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 100;
    width: 165px;
    padding: 6px;
    border: 1px solid var(--nd-login-border);
    border-radius: 11px;
    background: var(--nd-login-surface);
    box-shadow: var(--nd-login-shadow);
}

    .nd-appearance-menu[hidden] {
        display: none !important;
    }

.nd-appearance-option {
    display: block;
    width: 100%;
    padding: 11px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--nd-login-text);
    text-align: start;
    font-size: 13px;
}

    .nd-appearance-option:hover,
    .nd-appearance-option.active {
        background: var(--nd-login-bg);
        color: var(--nd-login-primary);
    }

html[dir="rtl"] .nd-appearance-menu {
    right: auto;
    left: 0;
}

/* =========================================================
   16. LOGIN FORM CONTAINER
   ========================================================= */

.nd-login-form-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 16px 30px 32px;
}

.nd-login-card {
    width: 100%;
    max-width: 405px;
    padding: 12px 0;
}

/* =========================================================
   17. SMALL FORM LOGO
   ========================================================= */

.nd-login-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 18px;
}

    .nd-login-logo img {
        display: block;
        width: auto;
        max-width: 155px;
        max-height: 75px;
        object-fit: contain;
        background: transparent;
    }

/* =========================================================
   18. LOGIN HEADING
   ========================================================= */

.nd-login-heading {
    margin-bottom: 26px;
}

.nd-login-eyebrow {
    margin-bottom: 10px;
    color: var(--nd-login-primary);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.2px;
}

.nd-login-heading h2 {
    margin: 0 0 9px;
    color: var(--nd-login-text);
    font-size: clamp(27px,2.4vw,33px);
    font-weight: 800;
    line-height: 1.3;
}

.nd-login-heading p {
    margin: 0;
    color: var(--nd-login-muted);
    font-size: 13px;
    line-height: 1.7;
}

/* =========================================================
   19. INPUT FIELDS
   ========================================================= */

.nd-field {
    margin-bottom: 19px;
}

    .nd-field > label {
        display: block;
        margin-bottom: 8px;
        color: var(--nd-login-text);
        font-size: 13px;
        font-weight: 650;
    }

.nd-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.nd-input-icon {
    position: absolute;
    inset-inline-start: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--nd-login-muted);
    pointer-events: none;
    z-index: 1;
}

.nd-login-input {
    display: block;
    width: 100%;
    height: 49px;
    padding: 0 46px;
    border: 1px solid var(--nd-login-border);
    border-radius: 11px;
    outline: 0;
    background: var(--nd-login-input);
    color: var(--nd-login-text);
    font-size: 14px;
    transition: border-color .2s, box-shadow .2s;
}

    .nd-login-input::placeholder {
        color: #9ca7b5;
    }

    .nd-login-input:focus {
        border-color: var(--nd-login-primary);
        box-shadow: 0 0 0 3px rgba(23,162,184,.10);
    }

/* PASSWORD VISIBILITY */

.nd-password-toggle {
    position: absolute;
    inset-inline-end: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--nd-login-muted);
}

    .nd-password-toggle:hover,
    .nd-password-toggle.active {
        color: var(--nd-login-primary);
        background: var(--nd-login-bg);
    }

/* =========================================================
   20. VALIDATION
   ========================================================= */

.nd-field-error {
    display: block;
    margin-top: 7px;
    color: #dc3545;
    font-size: 12px;
    line-height: 1.5;
}

    .nd-field-error[hidden] {
        display: none !important;
    }

.nd-input-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220,53,69,.08) !important;
}

.nd-login-alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid rgba(220,53,69,.20);
    border-radius: 9px;
    background: rgba(220,53,69,.07);
    color: #dc3545;
    font-size: 13px;
    line-height: 1.6;
}

    .nd-login-alert:empty {
        display: none;
    }

    .nd-login-alert ul {
        margin: 0;
        padding-inline-start: 18px;
    }

/* =========================================================
   21. REMEMBER USERNAME
   ========================================================= */

.nd-login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 23px;
}

.nd-remember-label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--nd-login-muted);
    font-size: 12px;
    cursor: pointer;
}

    .nd-remember-label input {
        width: 16px;
        height: 16px;
        margin: 0;
        accent-color: var(--nd-login-primary);
    }

/* =========================================================
   22. SUBMIT BUTTON
   ========================================================= */

.nd-login-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 51px;
    padding: 12px 18px;
    border: 0;
    border-radius: 11px;
    background: var(--nd-login-primary);
    color: #ffffff;
    font-size: 15px;
    font-weight: 750;
    box-shadow: 0 8px 20px rgba(0,0,0,.08);
    transition: filter .15s, transform .15s;
}

    .nd-login-submit:hover {
        filter: brightness(.93);
        transform: translateY(-1px);
    }

    .nd-login-submit:disabled {
        cursor: wait;
        opacity: .75;
        transform: none;
    }

.nd-submit-arrow {
    font-size: 20px;
}

/* =========================================================
   23. SECURE SIGN-IN
   ========================================================= */

.nd-login-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 22px;
    color: var(--nd-login-muted);
    font-size: 12px;
}

.nd-security-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #20b486;
}

/* =========================================================
   24. FORM FOOTER
   ========================================================= */

.nd-login-footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px 32px;
    color: var(--nd-login-muted);
    font-size: 11px;
}

/* =========================================================
   25. RTL / LTR TEXT DIRECTION
   ========================================================= */

html[dir="rtl"] .nd-login-card,
html[dir="rtl"] .nd-login-heading {
    text-align: right;
}

html[dir="ltr"] .nd-login-card,
html[dir="ltr"] .nd-login-heading {
    text-align: left;
}

html[dir="rtl"] .nd-login-input {
    text-align: right;
}

html[dir="ltr"] .nd-login-input {
    text-align: left;
}

html[dir="rtl"] .nd-brand-modern,
html[dir="ltr"] .nd-brand-modern {
    text-align: center;
}

/* =========================================================
   26. LOADING INDICATOR
   ========================================================= */

.nd-login-loader {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.72);
    backdrop-filter: blur(4px);
}

    .nd-login-loader.nd-visible {
        display: flex;
    }

html[data-nd-mode="dark"] .nd-login-loader {
    background: rgba(12,18,30,.75);
}

.nd-loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.nd-spinner {
    width: 48px;
    height: 48px;
    border: 5px solid rgba(130,145,160,.20);
    border-top-color: var(--nd-login-primary);
    border-radius: 50%;
    animation: nd-login-spin .8s linear infinite;
}

.nd-loader-text {
    color: var(--nd-login-text);
    font-size: 16px;
    font-weight: 700;
}

@keyframes nd-login-spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================================
   27. TABLET
   ========================================================= */

@media (max-width: 1100px) and (min-width: 768px) {

    /* English: Login LEFT, Branding RIGHT */
    .nd-login-shell.nd-login-ltr {
        grid-template-columns: minmax(0,58%) minmax(0,42%);
    }

    /* Arabic: Branding LEFT, Login RIGHT */
    .nd-login-shell.nd-login-rtl {
        grid-template-columns: minmax(0,42%) minmax(0,58%);
    }

    .nd-login-brand-panel {
        padding: 25px 22px;
    }

    .nd-brand-center.nd-brand-modern {
        padding: 18px 0;
    }

    .nd-brand-logo-card {
        width: min(100%,330px);
        height: 190px;
        margin-bottom: 18px;
    }

    .nd-brand-main-logo {
        max-width: 330px;
        max-height: 190px;
    }

    .nd-brand-modern h1 {
        font-size: 26px;
    }

    .nd-brand-modern p {
        font-size: 13px;
    }

    .nd-brand-modern .nd-brand-feature {
        white-space: normal;
    }

    .nd-login-form-container {
        padding-inline: 24px;
    }

    .nd-login-toolbar,
    .nd-login-footer {
        padding-inline: 24px;
    }
}

/* =========================================================
   28. MOBILE - LOGIN ONLY
   ========================================================= */

@media (max-width: 767px) {

    .nd-login-shell {
        display: flex;
        flex-direction: column;
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .nd-login-brand-panel {
        display: none !important;
    }

    .nd-login-form-panel {
        flex: 1;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .nd-login-toolbar {
        padding: 18px 20px 8px;
    }

    .nd-login-form-container {
        flex: 1;
        padding: 25px 22px 35px;
    }

    .nd-login-card {
        width: 100%;
        max-width: 430px;
    }

    .nd-login-logo {
        margin-bottom: 20px;
    }

        .nd-login-logo img {
            max-width: 150px;
            max-height: 70px;
        }

    .nd-login-heading {
        margin-bottom: 25px;
    }

    .nd-login-footer {
        padding: 16px 22px;
    }
}

/* =========================================================
   29. SMALL MOBILE
   ========================================================= */

@media (max-width: 380px) {

    .nd-login-form-container {
        padding-inline: 17px;
    }

    .nd-login-footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* =========================================================
   30. SHORT DESKTOP SCREENS
   ========================================================= */

@media (min-width: 768px) and (max-height: 750px) {

    .nd-login-brand-panel {
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .nd-brand-center.nd-brand-modern {
        padding: 12px 0;
    }

    .nd-brand-logo-card {
        width: min(100%,330px);
        height: 180px;
        margin-bottom: 14px;
    }

    .nd-brand-main-logo {
        max-width: 330px;
        max-height: 180px;
    }

    .nd-brand-modern h1 {
        font-size: 25px;
        margin-bottom: 8px;
    }

    .nd-brand-modern p {
        font-size: 12px;
    }

    .nd-brand-modern .nd-brand-features {
        margin-top: 16px;
    }

    .nd-login-toolbar {
        padding-top: 16px;
        padding-bottom: 12px;
    }

    .nd-login-form-container {
        padding-top: 8px;
        padding-bottom: 12px;
    }

    .nd-login-logo img {
        max-height: 55px;
    }

    .nd-login-heading {
        margin-bottom: 20px;
    }

    .nd-field {
        margin-bottom: 15px;
    }
}

/* =========================================================
   31. REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}
