/* ============================================================
   JUPITOR FINANCE PORTAL — Authentication Pages
   Shared stylesheet for index.php (login), forgot_password.php
   and reset_password.php. Self-contained (does not depend on
   style.css/forms.css) so these pages do not need the legacy
   admin-template CSS bundle.
   ============================================================ */

:root {
    --jup-primary: #1b2a6b;
    --jup-primary-dark: #111d52;
    --jup-accent: #13b8a6;
    --jup-accent-dark: #0e8f81;
    --jup-danger: #dc2626;

    --jup-border: #e5e7eb;
    --jup-border-hover: #cbd1df;
    --jup-input-bg: #f8f9fc;

    --jup-heading-color: #202535;
    --jup-body-color: #3d4353;
    --jup-muted: #73798a;

    --jup-radius-input: 10px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--jup-body-color);
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--jup-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--jup-accent);
}

/* ------------------------------------------------------------
   Layout — split screen (form left, brand visual right)
   ------------------------------------------------------------ */

.auth-page {
    min-height: 100vh;
    display: flex;
}

.auth-form-pane {
    flex: 1 1 46%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px clamp(24px, 6vw, 100px);
    background: #ffffff;
}

.auth-form-inner {
    width: 100%;
    max-width: 440px;
}

/* ------------------------------------------------------------
   Logo
   ------------------------------------------------------------ */

.auth-logo {
    display: block;
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo img {
    width: 170px;
    display: inline-block;
}

/* ------------------------------------------------------------
   Headings
   ------------------------------------------------------------ */

.auth-heading {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--jup-heading-color);
    margin: 0 0 6px;
}

.auth-subtext {
    color: var(--jup-muted);
    font-size: 0.92rem;
    margin: 0 0 28px;
}

/* ------------------------------------------------------------
   Form elements
   ------------------------------------------------------------ */

.form-group {
    margin-bottom: 20px;
}

.form-group:last-of-type {
    margin-bottom: 0;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--jup-heading-color);
}

.form-control {
    display: block;
    width: 100%;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--jup-body-color);
    background-color: var(--jup-input-bg);
    border: 1px solid var(--jup-border);
    border-radius: var(--jup-radius-input);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    appearance: none;
}

.form-control::placeholder {
    color: var(--jup-muted);
    opacity: 1;
}

.form-control:hover {
    border-color: var(--jup-border-hover);
}

.form-control:focus {
    outline: none;
    background-color: #ffffff;
    border-color: var(--jup-accent);
    box-shadow: 0 0 0 3px rgba(19, 184, 166, 0.15);
}

.form-control:disabled {
    background-color: #f1f2f6;
    color: var(--jup-muted);
    cursor: not-allowed;
}

.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--jup-body-color);
    box-shadow: 0 0 0 1000px #ffffff inset;
    border-color: var(--jup-accent);
    transition: background-color 5000s ease-in-out 0s;
}

/* Password field with inline show/hide toggle */

.form-input {
    position: relative;
}

.form-input .form-control {
    padding-right: 52px;
}

.show-hide {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
}

.show-hide span {
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--jup-accent);
    user-select: none;
}

.show-hide span.show::before {
    content: "show";
}

.show-hide span:not(.show)::before {
    content: "hide";
}

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 20px;
    font-family: inherit;
    font-size: 0.96rem;
    font-weight: 600;
    line-height: 1.4;
    border-radius: var(--jup-radius-input);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
    background-color: var(--jup-primary);
    border-color: var(--jup-primary);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--jup-primary-dark);
    border-color: var(--jup-primary-dark);
    color: #ffffff;
}

.btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(27, 42, 107, 0.25);
}

.btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* ------------------------------------------------------------
   Helper rows (form actions / links / footer)
   ------------------------------------------------------------ */

.form-actions {
    margin-top: 8px;
}

.auth-links {
    margin-top: 18px;
    text-align: center;
    font-size: 0.9rem;
}

.auth-links a {
    font-weight: 600;
}

.auth-powered-by {
    margin-top: 32px;
    font-size: 13px;
    color: var(--jup-muted);
    text-align: center;
}

/* ------------------------------------------------------------
   Test accounts panel (dev/staging helper, safe to remove for prod)
   ------------------------------------------------------------ */

.auth-test-accounts {
    margin-top: 24px;
    border: 1px solid var(--jup-border);
    border-radius: var(--jup-radius-input);
    background: var(--jup-input-bg);
    overflow: hidden;
}

.auth-test-accounts-toggle {
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--jup-primary);
    cursor: pointer;
}

.auth-test-accounts-toggle::after {
    content: '\25BE';
    float: right;
    transition: transform 0.15s ease;
}

.auth-test-accounts.open .auth-test-accounts-toggle::after {
    transform: rotate(180deg);
}

.auth-test-accounts-panel {
    display: none;
    padding: 0 14px 12px;
}

.auth-test-accounts.open .auth-test-accounts-panel {
    display: block;
}

.auth-test-accounts-note {
    margin: 0 0 8px;
    font-size: 0.8rem;
    color: var(--jup-muted);
}

.auth-test-accounts-note code {
    background: #ffffff;
    border: 1px solid var(--jup-border);
    border-radius: 4px;
    padding: 1px 5px;
}

.auth-test-accounts-panel ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.auth-test-accounts-panel li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.82rem;
    cursor: pointer;
}

.auth-test-accounts-panel li:hover {
    background: #ffffff;
}

.auth-test-accounts-panel li .role {
    font-weight: 600;
    color: var(--jup-heading-color);
}

.auth-test-accounts-panel li .email {
    color: var(--jup-muted);
}

/* ------------------------------------------------------------
   Visual pane (right side, hidden on tablet/mobile)
   ------------------------------------------------------------ */

.auth-visual-pane {
    flex: 1 1 54%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px clamp(40px, 6vw, 110px);
    background: linear-gradient(135deg, #1b2a6b 0%, #16215a 45%, #0e8f81 100%);
    overflow: hidden;
    color: #ffffff;
}

.auth-visual-pane::before,
.auth-visual-pane::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.auth-visual-pane::before {
    width: 320px;
    height: 320px;
    top: -90px;
    right: -90px;
    background: rgba(255, 255, 255, 0.06);
}

.auth-visual-pane::after {
    width: 220px;
    height: 220px;
    bottom: -70px;
    left: -70px;
    background: rgba(19, 184, 166, 0.16);
}

.auth-visual-content {
    position: relative;
    z-index: 1;
    max-width: 460px;
    text-align: center;
}

.auth-visual-content svg {
    width: 100%;
    max-width: 400px;
    height: auto;
    margin-bottom: 36px;
}

.auth-visual-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 12px;
    color: #ffffff;
}

.auth-visual-content p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
    margin: 0;
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */

@media (min-width: 1800px) {
    .auth-form-inner {
        max-width: 480px;
    }

    .auth-visual-content {
        max-width: 500px;
    }

    .auth-visual-content svg {
        max-width: 440px;
    }
}

@media (max-width: 991.98px) {
    .auth-visual-pane {
        display: none;
    }

    .auth-form-pane {
        flex: 1 1 100%;
    }
}

@media (max-width: 575.98px) {
    .auth-form-pane {
        justify-content: flex-start;
        padding: 36px 20px 28px;
    }

    .auth-logo img {
        width: 130px;
    }

    .auth-logo {
        margin-bottom: 24px;
    }

    .auth-heading {
        font-size: 1.15rem;
    }

    .auth-subtext {
        margin-bottom: 20px;
    }

    .form-group {
        margin-bottom: 16px;
    }

    .auth-links {
        margin-top: 14px;
    }

    .auth-powered-by {
        margin-top: 24px;
    }
}
