/* ============================================
   MANOHAR PIPE — Professional Auth Pages
   Split-screen layout with brand panel
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ---------- RESET ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --navy: #1a365d;
    --navy-light: #2a4a7f;
    --copper: #c4873b;
    --copper-light: #d4a05a;
    --white: #ffffff;
    --off-white: #f7f8fa;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --red-500: #ef4444;
    --red-50: #fef2f2;
    --green-500: #22c55e;
    --green-50: #f0fdf4;
    --blue-500: #3b82f6;
    --blue-50: #eff6ff;
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --transition: 150ms ease;
}

body.auth-page {
    font-family: var(--font);
    min-height: 100vh;
    background: var(--white);
    color: var(--gray-800);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   SPLIT LAYOUT
   ============================================ */
.auth-split {
    display: flex;
    min-height: 100vh;
}

/* ---------- LEFT — BRAND PANEL ---------- */
.auth-brand {
    width: 45%;
    min-height: 100vh;
    background: linear-gradient(160deg, #0f2440 0%, #1a365d 40%, #234681 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 48px;
    position: relative;
    overflow: hidden;
}

.auth-brand::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: 0;
}

.auth-brand__content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 420px;
}

.auth-brand__illustration {
    width: 100%;
    max-width: 340px;
    margin: 0 auto 40px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.auth-brand__illustration img {
    width: 100%;
    height: auto;
    display: block;
}

.auth-brand__logo {
    margin-bottom: 18px;
}

.auth-brand__logo img {
    height: 70px;
    width: auto;
    background: var(--white);
    padding: 8px;
    border-radius: var(--radius);
}

.auth-brand__tagline {
    color: rgba(255, 255, 255, 0.9);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.5px;
    margin-bottom: 16px;
}

.auth-brand__desc {
    color: rgba(255, 255, 255, 0.55);
    font-size: 15px;
    line-height: 1.6;
    font-weight: 400;
}

/* Copper accent line */
.auth-brand__accent {
    width: 48px;
    height: 3px;
    background: var(--copper);
    border-radius: 3px;
    margin: 24px auto 0;
}

/* ---------- RIGHT — FORM PANEL ---------- */
.auth-form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    overflow-y: auto;
    background: var(--white);
}

.auth-form-container {
    width: 100%;
    max-width: 440px;
}

.auth-form-container--wide {
    max-width: 520px;
}

/* ---------- MOBILE LOGO (hidden on desktop) ---------- */
.auth-mobile-logo {
    display: none;
    text-align: center;
    margin-bottom: 10px;
}

.auth-mobile-logo img {
    height: 80px;
    width: auto;
}

/* ---------- HEADER ---------- */
.auth-header {
    margin-bottom: 32px;
}

.auth-header__title {
    font-size: 28px;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.75px;
    line-height: 1.2;
}

.auth-header__subtitle {
    font-size: 15px;
    color: var(--gray-500);
    margin-top: 8px;
    font-weight: 400;
    line-height: 1.5;
}

/* ---------- ALERTS ---------- */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 24px;
    line-height: 1.4;
}

.auth-alert svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.auth-alert--error {
    background: var(--red-50);
    color: var(--red-500);
    border: 1px solid #fecaca;
}

.auth-alert--success {
    background: var(--green-50);
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.auth-alert--info {
    background: var(--blue-50);
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

/* ============================================
   FORM STYLES
   ============================================ */
.auth-form {
    /* container */
}

/* Field group */
.field {
    margin-bottom: 20px;
}

.field__label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.field__label .req {
    color: var(--red-500);
    margin-left: 1px;
}

/* Text / Email / Password inputs */
.field__input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    font-family: var(--font);
    font-size: 14px;
    color: var(--gray-800);
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.field__input::placeholder {
    color: var(--gray-400);
}

.field__input:hover {
    border-color: var(--gray-400);
}

.field__input:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.08);
}

.field__input--error,
.field__input--error:hover,
.field__input--error:focus {
    border-color: var(--red-500);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}

/* Select */
.field__select {
    width: 100%;
    height: 44px;
    padding: 0 36px 0 14px;
    font-family: var(--font);
    font-size: 14px;
    color: var(--gray-800);
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 0 1 .708 0L8 8.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.field__select:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.08);
}

.field__select--error {
    border-color: var(--red-500);
}

/* Textarea */
.field__textarea {
    width: 100%;
    padding: 10px 14px;
    font-family: var(--font);
    font-size: 14px;
    color: var(--gray-800);
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    outline: none;
    resize: vertical;
    min-height: 68px;
    line-height: 1.5;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.field__textarea::placeholder {
    color: var(--gray-400);
}

.field__textarea:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.08);
}

.field__textarea--error {
    border-color: var(--red-500);
}

/* Password wrapper */
.field__pw-wrap {
    position: relative;
}

.field__pw-wrap .field__input {
    padding-right: 44px;
}

.field__pw-toggle {
    position: absolute;
    right: 1px;
    top: 1px;
    bottom: 1px;
    width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    border-radius: 0 var(--radius) var(--radius) 0;
    transition: color var(--transition);
}

.field__pw-toggle:hover {
    color: var(--gray-600);
}

.field__pw-toggle svg {
    width: 18px;
    height: 18px;
}

/* Inline error */
.field__error {
    display: block;
    font-size: 12px;
    color: var(--red-500);
    margin-top: 4px;
    font-weight: 500;
}

/* Row — two columns */
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Section divider */
.auth-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 28px 0 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gray-400);
}

.auth-section::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

/* Options row (remember + forgot) */
.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.auth-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--gray-600);
    user-select: none;
}

.auth-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid var(--gray-300);
    cursor: pointer;
    accent-color: var(--navy);
}

.auth-link {
    font-size: 13px;
    color: var(--navy);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition);
}

.auth-link:hover {
    color: var(--copper);
    text-decoration: underline;
}

/* ============================================
   BUTTONS
   ============================================ */
.auth-btn {
    width: 100%;
    height: 46px;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.01em;
}

.auth-btn--primary {
    background: var(--navy);
    color: var(--white);
}

.auth-btn--primary:hover {
    background: var(--navy-light);
    box-shadow: var(--shadow-md);
}

.auth-btn--primary:active {
    transform: scale(0.99);
}

/* Loading */
.auth-btn--loading {
    opacity: 0.75;
    pointer-events: none;
}

.auth-btn__spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.5s linear infinite;
    display: none;
}

.auth-btn--loading .auth-btn__spinner {
    display: block;
}

.auth-btn--loading .auth-btn__text {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   FOOTER
   ============================================ */
.auth-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 14px;
    color: var(--gray-500);
}

.auth-footer a {
    color: var(--navy);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    color: var(--copper);
    text-decoration: underline;
}

/* ---------- BACK LINK ---------- */
.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-500);
    text-decoration: none;
    margin-bottom: 28px;
    transition: color var(--transition);
}

.auth-back:hover {
    color: var(--navy);
}

.auth-back svg {
    width: 16px;
    height: 16px;
}

/* ---------- PASSWORD STRENGTH ---------- */
.pw-strength {
    margin-top: 6px;
    display: none;
}

.pw-strength.visible {
    display: block;
}

.pw-strength__bar {
    height: 3px;
    border-radius: 3px;
    background: var(--gray-200);
    overflow: hidden;
}

.pw-strength__fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease, background 0.3s ease;
    width: 0;
}

.pw-strength__label {
    font-size: 11px;
    margin-top: 3px;
    font-weight: 600;
}

.pw-strength[data-level="1"] .pw-strength__fill {
    width: 25%;
    background: var(--red-500);
}

.pw-strength[data-level="1"] .pw-strength__label {
    color: var(--red-500);
}

.pw-strength[data-level="2"] .pw-strength__fill {
    width: 50%;
    background: #f59e0b;
}

.pw-strength[data-level="2"] .pw-strength__label {
    color: #f59e0b;
}

.pw-strength[data-level="3"] .pw-strength__fill {
    width: 75%;
    background: var(--green-500);
}

.pw-strength[data-level="3"] .pw-strength__label {
    color: var(--green-500);
}

.pw-strength[data-level="4"] .pw-strength__fill {
    width: 100%;
    background: #059669;
}

.pw-strength[data-level="4"] .pw-strength__label {
    color: #059669;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 960px) {
    .auth-brand {
        display: none;
    }

    .auth-mobile-logo {
        display: block;
    }

    .auth-form-panel {
        padding: 32px 24px;
    }

    .auth-header__title {
        font-size: 24px;
    }
}

@media (max-width: 520px) {
    .field-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .auth-form-panel {
        padding: 24px 20px;
    }

    .auth-header__title {
        font-size: 22px;
    }

    .auth-options {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}