/* ═══════════════════════════════════════════════════════
   AXK Login - Overrides frappe/public/scss/login.bundle.scss
   ═══════════════════════════════════════════════════════ */

/* ── Design tokens ── */
:root {
    --axk-lp: #14614E;
    --axk-lp-dark: #0D4134;
    --axk-lp-light: #89B0A6;
    --axk-lp-surface: #FFFFFF;
    --axk-lp-shell: #F7F7F7;
    --axk-lp-border: #EBEBEB;
    --axk-lp-text: #171717;
    --axk-lp-muted: #A3A3A3;
    --axk-lp-subtle: #5C5C5C;
}

[data-theme="dark"] {
    --axk-lp-surface: #171717;
    --axk-lp-shell: #262626;
    --axk-lp-border: #3A3A3A;
    --axk-lp-text: #FFFFFF;
    --axk-lp-muted: #7B7B7B;
    --axk-lp-subtle: #A3A3A3;
    --axk-lp-lp-light: #89B0A6;
}

/* ───────────────────────────────────────────────────────
   1. Frappe default overrides
   ─────────────────────────────────────────────────────── */

/* Override Frappe's background */
body[data-path="login"],
body[data-path="login"] .page-content-wrapper {
    background-color: var(--axk-lp-surface) !important;
    min-height: auto !important;
}

/* Reset container width/padding */
body[data-path="login"] main.container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

body[data-path="login"] main.my-4 {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Reset page_content padding */
body[data-path="login"] .page_content {
    padding: 0 !important;
}

/* Hide page chrome (header, breadcrumbs, footer) */
body[data-path="login"] .page-header-wrapper,
body[data-path="login"] .page-breadcrumbs,
body[data-path="login"] .page-footer,
body[data-path="login"] .web-footer,
body[data-path="login"] footer {
    display: none !important;
}

/* ── Flatten .page-card ── */
body[data-path="login"] .page-card {
    max-width: none !important;
    padding: 0 !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

body[data-path="login"] .page-card form {
    max-width: none !important;
    margin: 0 !important;
}

/* ── Restore input borders (Frappe strips them) ── */
body[data-path="login"] .page-card-body input[type="text"],
body[data-path="login"] .page-card-body input[type="email"],
body[data-path="login"] .page-card-body input[type="password"] {
    border: 1px solid var(--axk-lp-border) !important;
    border-radius: 10px !important;
    height: 40px !important;
    color: var(--axk-lp-text) !important;
    font-size: 14px !important;
    background-color: var(--axk-lp-surface) !important;
    margin-bottom: 0 !important;
    padding-left: 12px !important;
    /* override Frappe's 35px left indent */
    transition: border-color 0.2s, box-shadow 0.2s;
}

body[data-path="login"] .page-card-body input::placeholder {
    color: var(--axk-lp-muted) !important;
    font-weight: 400 !important;
}

body[data-path="login"] .page-card-body input:focus {
    border-color: var(--axk-lp) !important;
    box-shadow: 0 0 0 2px rgba(20, 97, 78, 0.12) !important;
    outline: none !important;
}

/* ── Reset .page-card-head logo max-height ── */
body[data-path="login"] .page-card-head img {
    max-height: none !important;
}

/* ── Sign-up message ── */
body[data-path="login"] .sign-up-message {
    font-size: 12px;
    color: var(--axk-lp-muted);
}

body[data-path="login"] .sign-up-message a {
    color: var(--axk-lp-subtle);
}

/* ───────────────────────────────────────────────────────
   2. AXK login layout
   ─────────────────────────────────────────────────────── */

/* Root container */
.axk-login-root {
    min-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 8px 16px;
    background: var(--axk-lp-surface);
}

/* Background: subtle grid pattern (auth3.png) */
.axk-login-root::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("/assets/axk_network/images/axk-login-grid.png") center / cover no-repeat;
    z-index: 0;
    pointer-events: none;
}

/* ── "Did you face any issues?" ── */
.axk-login-help {
    text-align: right;
    font-size: 12px;
    color: var(--axk-lp-muted);
    margin-bottom: 10px;
    position: relative;
    z-index: 20;
    width: 100%;
    max-width: 1080px;
}

.axk-login-help a {
    color: var(--axk-lp-subtle);
    font-weight: 500;
    text-decoration: underline;
}

.axk-login-help a:hover {
    color: var(--axk-lp);
}

/* ── Section wrappers ── */
.for-login,
.for-email-login,
.for-signup,
.for-forgot,
.for-login-with-email-link {
    max-width: 1080px;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    position: relative;
    z-index: 20;
}

/* ── Shell: the card holding left + right panels ── */
.axk-login-shell {
    display: grid;
    grid-template-columns: 1fr;
    border-radius: 36px;
    padding: 2px;
    background: var(--axk-lp-shell);
    position: relative;
    z-index: 20;
}

/* ── Left panel (form side) ── */
.axk-login-left {
    background: var(--axk-lp-surface);
    border-radius: 36px;
    padding: 32px 28px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ── Logo / heading block ── */
.axk-page-card-head {
    text-align: center;
    margin-bottom: 18px;
    padding: 0 !important;
    /* override Frappe's padding */
    font-size: inherit !important;
    /* override Frappe's font-size */
}

.axk-page-card-head .app-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    margin-bottom: 10px;
    border-radius: 12px;
}

.axk-page-card-head h4 {
    margin: 0 !important;
    color: var(--axk-lp-text);
    font-size: 16px !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
}

.axk-page-card-head p {
    margin: 4px 0 0;
    color: var(--axk-lp-muted);
    font-size: 14px;
    font-weight: 400;
}

/* ── Form card (reset Frappe defaults) ── */
.login-content.page-card {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
}

.login-content.page-card form {
    max-width: none !important;
    margin: 0 !important;
}

/* ── Labels ── */
body[data-path="login"] .form-label {
    color: var(--axk-lp-text) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    margin-bottom: 6px !important;
}

/* ── Form groups ── */
body[data-path="login"] .form-group {
    margin-bottom: 14px !important;
}

/* ── Toggle password ── */
body[data-path="login"] .password-field {
    position: relative;
}

body[data-path="login"] .toggle-password {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    left: auto !important;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--axk-lp-muted) !important;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
}

/* Ensure the SVG inside toggle-password is small */
body[data-path="login"] .toggle-password svg {
    width: 16px !important;
    height: 16px !important;
}

/* ── Forgot password ── */
body[data-path="login"] .forgot-password-message {
    margin: 6px 0 0 !important;
    text-align: right;
    line-height: 1;
}

body[data-path="login"] .forgot-password-message a {
    color: var(--axk-lp-subtle) !important;
    font-size: 14px !important;
    text-decoration: none;
}

body[data-path="login"] .forgot-password-message a:hover {
    color: var(--axk-lp) !important;
}

/* ── Submit button ── */
body[data-path="login"] .page-card-actions {
    margin-top: 4px !important;
}

body[data-path="login"] .page-card-actions .btn.btn-primary {
    margin-top: 10px;
    border: none;
    border-radius: 10px;
    height: 42px;
    font-size: 14px;
    font-weight: 600;
    background: var(--axk-lp) !important;
    color: #fff !important;
    transition: background 0.2s;
}

body[data-path="login"] .page-card-actions .btn.btn-primary:hover,
body[data-path="login"] .page-card-actions .btn.btn-primary:focus {
    background: var(--axk-lp-dark) !important;
}

/* ── Secure connection badge ── */
.axk-secure-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 18px;
    font-size: 10px;
    color: #999;
    letter-spacing: 0.01em;
}

.axk-secure-badge svg {
    width: 12px !important;
    height: 12px !important;
    flex-shrink: 0;
}

/* ── Social login buttons ── */
body[data-path="login"] .social-login-buttons .btn {
    border-radius: 10px;
}

/* ── Sign-up / register link ── */
body[data-path="login"] .sign-up-message {
    margin-top: 20px !important;
    margin-bottom: 0 !important;
    font-size: 12px;
    color: var(--axk-lp-muted);
    text-align: center;
}

body[data-path="login"] .sign-up-message a {
    color: var(--axk-lp-subtle) !important;
    text-decoration: underline;
}

body[data-path="login"] .sign-up-message a:hover {
    color: var(--axk-lp) !important;
}

/* ── RIGHT PANEL (illustration + tagline) ── */
.axk-login-right {
    display: none;
}

.axk-login-right-content {
    background: transparent;
    border-radius: 28px;
    padding: 30px 26px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 14px;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Subtle dot overlay pattern (auth2.png) */
.axk-login-right-content::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("/assets/axk_network/images/axk-login-dots.png") center top / 100% auto no-repeat;
    opacity: 0.6;
    z-index: 0;
    pointer-events: none;
}

.axk-login-right-content>* {
    position: relative;
    z-index: 1;
}

.axk-login-right-content h3 {
    color: var(--axk-lp-dark);
    font-size: 24px;
    font-weight: 500;
    line-height: 1.2;
    margin: 0 0 4px;
    max-width: 80%;
}

[data-theme="dark"] .axk-login-right-content h3 {
    color: var(--axk-lp-light);
}

.axk-login-right-content p {
    color: var(--axk-lp-muted);
    font-size: 14px;
    line-height: 1.45;
    margin-bottom: 6px;
    max-width: 80%;
}

.axk-login-right-content img {
    width: 100%;
    max-width: 430px;
    max-height: 300px;
    object-fit: contain;
}

/* ── Legal footer ── */
.axk-login-legal {
    text-align: center;
    color: var(--axk-lp-muted);
    font-size: 12px;
    margin: 14px 0 0;
    position: relative;
    z-index: 20;
}

.axk-login-legal a {
    color: var(--axk-lp-subtle);
    text-decoration: none;
}

.axk-login-legal a:hover {
    color: var(--axk-lp);
}

/* ═══════════════════════════════════════════════════════
   3. Desktop breakpoint — two-column grid
   ═══════════════════════════════════════════════════════ */
@media (min-width: 992px) {
    .axk-login-root {
        padding: 8px 64px;
    }

    .axk-login-shell {
        grid-template-columns: minmax(380px, 460px) 1fr;
        gap: 0;
        min-height: 540px;
    }

    .axk-login-left {
        border-radius: 36px;
        padding: 38px 40px 32px;
    }

    .axk-login-right {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px 24px;
        border-radius: 0 36px 36px 0;
        position: relative;
        overflow: hidden;
    }
}