/*
 * iHospi Auth Pages Styles
 * Brand: iHospi | "Smart Hospital, Smarter Care"
 * Company: iSoftInt
 *
 * Color Scheme:
 *   --primary:   #0E4DA4  (Deep Blue)
 *   --secondary: #12B4A0  (Teal Green)
 *   --accent:    #FF6B35  (Orange - CTA)
 */

/* =========================================================
   CSS VARIABLES
   ========================================================= */
:root {
    --auth-primary:   #0E4DA4;
    --auth-secondary: #12B4A0;
    --auth-accent:    #FF6B35;
    --auth-dark:      #1A1A2E;
    --auth-text:      #1f2937;
    --auth-muted:     #6b7280;
    --auth-border:    #e5e7eb;
    --auth-bg:        #f8fafb;
    --auth-white:     #ffffff;
    --auth-radius:    14px;
    --auth-shadow:    0 8px 40px rgba(14, 77, 164, 0.10);
    --auth-font:      'Inter', 'Segoe UI', sans-serif;
    --auth-font-head: 'Poppins', 'Inter', sans-serif;
}

/* =========================================================
   BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
}

.ih-auth-body {
    font-family: var(--auth-font);
    background: var(--auth-bg);
    color: var(--auth-text);
    min-height: 100vh;
    display: flex;
    align-items: stretch;
}

/* =========================================================
   TWO-COLUMN WRAPPER
   ========================================================= */
.ih-auth-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* =========================================================
   LEFT PANEL — Branding
   ========================================================= */
.ih-auth-panel {
    flex: 0 0 48%;
    background: linear-gradient(150deg, #0E4DA4 0%, #0a3880 40%, #12B4A0 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 48px;
    position: relative;
    overflow: hidden;
}

/* Decorative blobs */
.ih-auth-panel::before {
    content: '';
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    top: -120px;
    right: -120px;
    pointer-events: none;
}
.ih-auth-panel::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    bottom: -80px;
    left: -80px;
    pointer-events: none;
}

/* Logo */
.ih-auth-logo {
    height: 64px;
    width: auto;
    object-fit: contain;
    margin-bottom: 28px;
    filter: brightness(0) invert(1);
    position: relative;
    z-index: 1;
}

/* Tagline */
.ih-auth-tagline {
    font-family: var(--auth-font-head);
    font-size: 1.65rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    line-height: 1.3;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.ih-auth-tagline span {
    display: block;
    font-size: 1rem;
    font-weight: 400;
    opacity: .75;
    margin-top: 6px;
    font-family: var(--auth-font);
}

/* Illustration area */
.ih-auth-illustration {
    margin: 36px 0;
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 320px;
}

.ih-auth-illustration svg {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 12px 40px rgba(0,0,0,0.18));
}

/* Feature bullets */
.ih-auth-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 320px;
}

.ih-auth-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.90);
    font-size: 0.92rem;
    line-height: 1.4;
}

.ih-auth-features li .ih-feat-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 10px;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: #fff;
    backdrop-filter: blur(4px);
}

/* =========================================================
   RIGHT PANEL — Form
   ========================================================= */
.ih-auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    background: var(--auth-white);
}

.ih-auth-form-wrap {
    width: 100%;
    max-width: 420px;
}

/* Heading */
.ih-auth-heading {
    font-family: var(--auth-font-head);
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--auth-dark);
    margin-bottom: 6px;
    line-height: 1.2;
}

.ih-auth-subheading {
    font-size: 0.95rem;
    color: var(--auth-muted);
    margin-bottom: 36px;
}

/* =========================================================
   FORM ELEMENTS
   ========================================================= */

/* Input group wrapper */
.ih-input-group {
    position: relative;
    margin-bottom: 20px;
}

.ih-input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--auth-text);
    margin-bottom: 7px;
    letter-spacing: .01em;
}

/* Icon prefix — positioned relative to the input, not the whole group */
.ih-input-icon {
    position: absolute;
    left: 14px;
    /* label is ~(0.85rem * 1.2 line-height) + 7px margin = ~17px + 7px = ~24px */
    bottom: 0;
    height: calc(100% - 28px); /* full group height minus label area */
    display: flex;
    align-items: center;
    color: var(--auth-muted);
    font-size: 0.9rem;
    pointer-events: none;
    transition: color .2s;
}

/* The actual input */
.ih-input {
    width: 100%;
    padding: 12px 44px 12px 40px;
    border: 1.5px solid var(--auth-border);
    border-radius: 10px;
    font-family: var(--auth-font);
    font-size: 0.95rem;
    color: var(--auth-text);
    background: #fff;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    appearance: none;
}

.ih-input:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgba(14, 77, 164, 0.10);
}

.ih-input:focus + .ih-input-icon,
.ih-input-group:focus-within .ih-input-icon {
    color: var(--auth-primary);
}

/* Input validation states */
.ih-input.input-validation-error {
    border-color: #ef4444;
}

/* Password toggle button */
.ih-pw-toggle {
    position: absolute;
    right: 14px;
    bottom: 0;
    height: calc(100% - 28px);
    display: flex;
    align-items: center;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--auth-muted);
    font-size: 0.9rem;
    line-height: 1;
    transition: color .2s;
}

.ih-pw-toggle:hover {
    color: var(--auth-primary);
}

/* Validation messages */
.field-validation-error {
    display: block;
    font-size: 0.8rem;
    color: #ef4444;
    margin-top: 5px;
}

/* =========================================================
   REMEMBER ME + FORGOT
   ========================================================= */
.ih-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 8px;
}

.ih-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--auth-text);
    cursor: pointer;
    user-select: none;
}

.ih-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--auth-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.ih-forgot {
    font-size: 0.875rem;
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color .2s;
    white-space: nowrap;
}

.ih-forgot:hover {
    color: var(--auth-secondary);
    text-decoration: underline;
}

/* =========================================================
   SUBMIT BUTTON
   ========================================================= */
.ih-btn-signin {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 24px;
    background: var(--auth-accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: var(--auth-font);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .02em;
    cursor: pointer;
    transition: background .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 4px 18px rgba(255, 107, 53, 0.35);
}

.ih-btn-signin:hover {
    background: #e85d27;
    box-shadow: 0 6px 24px rgba(255, 107, 53, 0.45);
    transform: translateY(-1px);
}

.ih-btn-signin:active {
    transform: translateY(0);
}

/* =========================================================
   DIVIDER
   ========================================================= */
.ih-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    color: var(--auth-muted);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.ih-divider::before,
.ih-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--auth-border);
}

/* =========================================================
   REGISTER LINK
   ========================================================= */
.ih-auth-alt {
    text-align: center;
    font-size: 0.9rem;
    color: var(--auth-muted);
}

.ih-auth-alt a {
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
    transition: color .2s;
}

.ih-auth-alt a:hover {
    color: var(--auth-secondary);
    text-decoration: underline;
}

/* =========================================================
   SERVER-SIDE ERROR ALERT
   ========================================================= */
.ih-alert-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-left: 4px solid #ef4444;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 24px;
    font-size: 0.88rem;
    color: #b91c1c;
    line-height: 1.5;
}

.ih-alert-error i {
    color: #ef4444;
    margin-top: 1px;
    flex-shrink: 0;
}

/* =========================================================
   BACK TO HOME LINK
   ========================================================= */
.ih-auth-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--auth-muted);
    text-decoration: none;
    margin-bottom: 36px;
    transition: color .2s, gap .2s;
}

.ih-auth-back:hover {
    color: var(--auth-primary);
    gap: 10px;
}

/* =========================================================
   RESPONSIVE — mobile: hide left panel
   ========================================================= */
@media (max-width: 991.98px) {
    .ih-auth-panel {
        display: none;
    }

    .ih-auth-form-panel {
        padding: 40px 20px;
    }

    .ih-auth-body {
        background: var(--auth-white);
    }
}

@media (max-width: 575.98px) {
    .ih-auth-form-wrap {
        max-width: 100%;
    }

    .ih-auth-heading {
        font-size: 1.55rem;
    }
}


/* =========================================================
   REGISTRATION PAGE EXTRAS
   ========================================================= */

/* Two-column input row (side-by-side on desktop) */
.ih-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

@media (max-width: 575.98px) {
    .ih-input-row {
        grid-template-columns: 1fr;
    }
}

/* Section divider label inside form */
.ih-form-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--auth-muted);
    margin: 24px 0 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ih-form-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--auth-border);
}

/* =========================================================
   PASSWORD STRENGTH INDICATOR
   ========================================================= */
.ih-pw-strength {
    margin-top: 8px;
}

.ih-pw-strength-bar {
    height: 4px;
    border-radius: 4px;
    background: var(--auth-border);
    overflow: hidden;
    margin-bottom: 5px;
}

.ih-pw-strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width .3s ease, background .3s ease;
}

.ih-pw-strength-fill.weak   { width: 33%; background: #ef4444; }
.ih-pw-strength-fill.medium { width: 66%; background: #f59e0b; }
.ih-pw-strength-fill.strong { width: 100%; background: #22c55e; }

.ih-pw-strength-text {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--auth-muted);
    transition: color .3s;
}

.ih-pw-strength-text.weak   { color: #ef4444; }
.ih-pw-strength-text.medium { color: #f59e0b; }
.ih-pw-strength-text.strong { color: #22c55e; }

/* =========================================================
   TERMS CHECKBOX ROW
   ========================================================= */
.ih-terms-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 24px;
    font-size: 0.875rem;
    color: var(--auth-text);
    line-height: 1.5;
}

.ih-terms-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    accent-color: var(--auth-primary);
    cursor: pointer;
    margin-top: 2px;
}

.ih-terms-row a {
    color: var(--auth-primary);
    font-weight: 500;
    text-decoration: none;
    transition: color .2s;
}

.ih-terms-row a:hover {
    color: var(--auth-secondary);
    text-decoration: underline;
}

/* =========================================================
   CREATE ACCOUNT BUTTON
   ========================================================= */
.ih-btn-register {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 24px;
    background: var(--auth-accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: var(--auth-font);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .02em;
    cursor: pointer;
    transition: background .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 4px 18px rgba(255, 107, 53, 0.35);
}

.ih-btn-register:hover {
    background: #e85d27;
    box-shadow: 0 6px 24px rgba(255, 107, 53, 0.45);
    transform: translateY(-1px);
}

.ih-btn-register:active {
    transform: translateY(0);
}


/* =========================================================
   FORGOT / RESET PASSWORD PAGES
   ========================================================= */

/* Info note beneath heading */
.ih-auth-note {
    font-size: 0.92rem;
    color: var(--auth-muted);
    line-height: 1.65;
    margin-bottom: 28px;
    padding: 14px 16px;
    background: #f0f7ff;
    border-left: 4px solid var(--auth-primary);
    border-radius: 8px;
}

.ih-auth-note strong {
    color: var(--auth-text);
}

/* Success / confirmation state */
.ih-alert-success {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-left: 4px solid #22c55e;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 24px;
    font-size: 0.92rem;
    color: #15803d;
    line-height: 1.6;
}

.ih-alert-success i {
    color: #22c55e;
    font-size: 1.1rem;
    margin-top: 1px;
    flex-shrink: 0;
}

/* Generic primary action button (shared across forgot/reset) */
.ih-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 24px;
    background: var(--auth-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: var(--auth-font);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .02em;
    cursor: pointer;
    transition: background .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 4px 18px rgba(14, 77, 164, 0.28);
}

.ih-btn-primary:hover {
    background: #0a3d8f;
    box-shadow: 0 6px 24px rgba(14, 77, 164, 0.38);
    transform: translateY(-1px);
}

.ih-btn-primary:active {
    transform: translateY(0);
}

/* Small centred back link row */
.ih-back-row {
    text-align: center;
    margin-top: 20px;
    font-size: 0.875rem;
    color: var(--auth-muted);
}

.ih-back-row a {
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
    transition: color .2s;
}

.ih-back-row a:hover {
    color: var(--auth-secondary);
    text-decoration: underline;
}

/* Confirmation page centred card */
.ih-confirm-card {
    text-align: center;
    padding: 16px 0 8px;
}

.ih-confirm-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #f0fdf4;
    border: 2px solid #bbf7d0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #22c55e;
    margin-bottom: 20px;
}

.ih-confirm-card h2 {
    font-family: var(--auth-font-head);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--auth-dark);
    margin-bottom: 10px;
}

.ih-confirm-card p {
    font-size: 0.93rem;
    color: var(--auth-muted);
    line-height: 1.65;
    margin-bottom: 0;
}


/* =========================================================
   AUTH — ADDITIONAL MOBILE FIXES
   ========================================================= */

/* Tablet: form panel comfortable padding */
@media (max-width: 767.98px) {
    .ih-auth-form-panel {
        padding: 36px 24px;
    }

    .ih-auth-heading {
        font-size: 1.65rem;
    }
}

/* Mobile: tighten up spacing */
@media (max-width: 575.98px) {
    .ih-auth-form-panel {
        padding: 28px 16px;
    }

    .ih-auth-heading {
        font-size: 1.45rem;
    }

    .ih-auth-subheading {
        font-size: 0.88rem;
        margin-bottom: 24px;
    }

    .ih-input-group label {
        font-size: 0.82rem;
    }

    .ih-input {
        font-size: 0.9rem;
        padding: 11px 42px 11px 38px;
    }

    .ih-btn-signin,
    .ih-btn-register,
    .ih-btn-primary {
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .ih-form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 20px;
    }

    /* Registration: section labels less top margin */
    .ih-form-section-label {
        margin-top: 16px;
        margin-bottom: 10px;
    }

    /* Confirm card icon smaller */
    .ih-confirm-icon {
        width: 60px;
        height: 60px;
        font-size: 1.6rem;
    }

    .ih-confirm-card h2 {
        font-size: 1.25rem;
    }
}

/* Small phone (≤375px) */
@media (max-width: 375px) {
    .ih-auth-form-panel {
        padding: 20px 12px;
    }

    .ih-auth-heading {
        font-size: 1.3rem;
    }

    .ih-auth-back {
        font-size: 0.78rem;
        margin-bottom: 24px;
    }
}
