* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --purple-dark: #6a11cb;
    --purple-light: #a044ff;
    --bg: #f5f7fb;
    --card-bg: #eef1f6;
    --text-dark: #1a1a2e;
    --text-muted: #888;
    --white: #ffffff;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    position: relative;
    padding: 24px 0;
}

/* ===== ANIMATED BACKGROUND BLOBS ===== */
.bg-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    animation: drift 12s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}
.bg-blob-1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, #a044ff, #6a11cb);
    top: -180px; left: -120px;
    animation-delay: 0s;
}
.bg-blob-2 {
    width: 380px; height: 380px;
    background: radial-gradient(circle, #6a11cb, #a044ff);
    bottom: -140px; right: -100px;
    animation-delay: -5s;
}
@keyframes drift {
    0%, 100% { transform: translate(0,0) scale(1); }
    33%       { transform: translate(30px,-40px) scale(1.06); }
    66%       { transform: translate(-20px,25px) scale(0.95); }
}

/* ===== WRAPPER ===== */
.wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    width: min(980px, calc(100% - 48px));
    height: 560px;
    background: var(--white);
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(106,17,203,0.15), 0 8px 24px rgba(0,0,0,0.06);
    animation: fadeUp 0.7s ease forwards;
    opacity: 0;
    transform: translateY(20px);
    overflow: hidden;
}

@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

/* ===== LEFT PANEL ===== */
.left {
    width: 46%;
    background: linear-gradient(145deg, #6a11cb 0%, #8b2fec 50%, #a044ff 100%);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 60px 40px;
    position: relative;
    height: 100%;
    overflow: hidden;
}

.left::before {
    content: '';
    position: absolute;
    width: 320px; height: 320px;
    border: 2px solid rgba(255,255,255,0.12);
    border-radius: 50%;
    top: -100px; right: -100px;
}
.left::after {
    content: '';
    position: absolute;
    width: 220px; height: 220px;
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: 50%;
    bottom: -70px; left: -70px;
}

.left-inner { position: relative; z-index: 1; }

.left-icon {
    width: 72px; height: 72px;
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.25);
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 18px;
    backdrop-filter: blur(6px);
    font-size: 30px;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.2); }
    50%       { box-shadow: 0 0 0 14px rgba(255,255,255,0); }
}

.left h1 {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    line-height: 1.35;
    margin-bottom: 10px;
    font-weight: 700;
}

.left-divider {
    width: 40px; height: 2px;
    background: rgba(255,255,255,0.4);
    border-radius: 2px;
    margin: 0 auto 20px;
}

.left p {
    font-size: 13.5px;
    opacity: 0.8;
    line-height: 1.7;
    margin-bottom: 28px;
    font-weight: 300;
}

.left-steps {
    list-style: none;
    text-align: left;
    margin-bottom: 20px;
    width: 100%;
}

.left-steps li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    opacity: 0.85;
    margin-bottom: 10px;
}

.left-steps li i {
    width: 24px; height: 24px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.left-steps li.is-complete { color: #e7fff0; opacity: 1; }
.left-steps li.is-complete i {
    background: #22c55e;
    color: white;
    box-shadow: 0 0 0 4px rgba(74,222,128,0.18);
    transform: scale(1.06);
}

.btn-login {
    padding: 11px 32px;
    border-radius: 30px;
    border: 2px solid rgba(255,255,255,0.6);
    background: transparent;
    color: white;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.3s;
    display: inline-flex; align-items: center; gap: 8px;
    text-decoration: none;
}
.btn-login:hover { background: white; color: var(--purple-dark); border-color: white; }

/* ===== RIGHT PANEL ===== */
.right {
    width: 54%;
    padding: 32px 44px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.right::-webkit-scrollbar { width: 5px; }
.right::-webkit-scrollbar-thumb { background: rgba(106,17,203,0.3); border-radius: 10px; }

.right-header { margin-bottom: 24px; }

.right-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    color: var(--text-dark);
    font-weight: 700;
    margin-bottom: 4px;
}
.right-header p { font-size: 14px; color: var(--text-muted); font-weight: 300; }

/* ===== MESSAGES ===== */
.messages { margin-bottom: 16px; }

.alert-error, .alert-success {
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 13px;
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 8px;
}
.alert-error   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

/* ===== SECTION HEADER ===== */
.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0 10px;
    padding-bottom: 10px;
    border-bottom: 1.5px solid rgba(106,17,203,0.1);
}

.section-header-icon {
    width: 30px; height: 30px;
    background: linear-gradient(135deg, var(--purple-dark), var(--purple-light));
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
}

.section-header span {
    font-size: 13px;
    font-weight: 600;
    color: var(--purple-dark);
    letter-spacing: 0.3px;
}

/* ===== FORM GRID ===== */
.form-row { display: flex; gap: 14px; }
.form-row .input-group { flex: 1; }

/* ===== INPUT GROUP ===== */
.input-group { margin-bottom: 14px; }

.input-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 6px;
    display: block;
}

.input-wrap {
    position: relative;
}

.input-wrap input,
.input-wrap select,
.input-wrap textarea {
    width: 100%;
    padding: 11px 16px 11px 42px;
    border-radius: 12px;
    border: 1.5px solid rgba(106,17,203,0.13);
    background: var(--bg);
    font-family: 'DM Sans', sans-serif;
    font-size: 13.5px;
    color: var(--text-dark);
    outline: none;
    transition: 0.25s;
}

.input-wrap input:focus,
.input-wrap select:focus,
.input-wrap textarea:focus {
    border-color: var(--purple-dark);
    background: white;
    box-shadow: 0 0 0 4px rgba(106,17,203,0.07);
}

.input-wrap input::placeholder,
.input-wrap textarea::placeholder { color: #bbb; font-size: 13px; }

.input-wrap select { appearance: none; cursor: pointer; }

.input-wrap textarea {
    resize: vertical;
    min-height: 80px;
    padding-top: 11px;
}

/* No icon inputs */
.input-wrap.no-icon input,
.input-wrap.no-icon select,
.input-wrap.no-icon textarea {
    padding-left: 16px;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #bbb;
    font-size: 16px;
    transition: 0.25s;
    pointer-events: none;
}

.input-wrap.textarea-wrap .input-icon { top: 15px; transform: none; }

.input-wrap:focus-within .input-icon { color: var(--purple-dark); }

.input-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #bbb;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
}
.input-toggle:hover { color: var(--purple-dark); }

/* File input */
.file-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    border-radius: 12px;
    border: 1.5px dashed rgba(106,17,203,0.25);
    background: var(--bg);
    cursor: pointer;
    transition: 0.25s;
    font-size: 13px;
    color: var(--text-muted);
}
.file-label:hover { border-color: var(--purple-dark); background: rgba(106,17,203,0.04); color: var(--purple-dark); }
.file-label i { font-size: 18px; color: var(--purple-light); }
.file-label input[type="file"] { display: none; }

/* ===== PASSWORD STRENGTH INDICATOR ===== */
.password-strength {
    margin-top: 8px;
}

.strength-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
}

.strength-bar span {
    flex: 1;
    height: 4px;
    border-radius: 4px;
    background: rgba(106,17,203,0.1);
    transition: background 0.3s ease;
}

.strength-bar span.active-weak    { background: #ef4444; }
.strength-bar span.active-fair    { background: #f97316; }
.strength-bar span.active-good    { background: #eab308; }
.strength-bar span.active-strong  { background: #22c55e; }

.strength-label {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
    transition: color 0.3s;
}

.password-checklist {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
    padding: 10px 12px;
    background: var(--bg);
    border-radius: 10px;
    border: 1.5px solid rgba(106,17,203,0.08);
}

.check-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: var(--text-muted);
    transition: color 0.25s;
}

.check-item i {
    font-size: 14px;
    color: #d1d5db;
    transition: color 0.25s;
    flex-shrink: 0;
}

.check-item.passed { color: #15803d; }
.check-item.passed i { color: #22c55e; }

/* ===== FILE UPLOAD PREVIEW ===== */
.file-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1.5px solid rgba(34,197,94,0.35);
    background: rgba(240,253,244,0.8);
    flex-wrap: wrap;
}

.file-preview-img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid rgba(34,197,94,0.3);
    flex-shrink: 0;
}

.file-preview-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    font-size: 13px;
    color: #15803d;
    font-weight: 500;
}

.file-reupload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid rgba(106,17,203,0.25);
    background: white;
    color: var(--purple-dark);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    font-family: 'DM Sans', sans-serif;
}
.file-reupload-btn:hover {
    background: var(--purple-dark);
    color: white;
    border-color: var(--purple-dark);
}

/* ===== REGISTER BUTTON ===== */
.register-btn {
    width: 100%;
    padding: 14px;
    border-radius: 30px;
    border: none;
    background: linear-gradient(135deg, var(--purple-dark), var(--purple-light));
    color: white;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 20px;
    transition: 0.3s;
    box-shadow: 0 6px 20px rgba(106,17,203,0.32);
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.register-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(106,17,203,0.42); }
.register-btn:active { transform: translateY(0); }

.login-link {
    text-align: center;
    margin-top: 18px;
    font-size: 13.5px;
    color: var(--text-muted);
}
.login-link a { color: var(--purple-dark); font-weight: 500; text-decoration: none; }
.login-link a:hover { text-decoration: underline; }

/* ===== RESPONSIVE ===== */
@media (max-width: 860px) {
    body { align-items: flex-start; padding: 16px; }
    .wrapper {
        flex-direction: column; width: min(100%, 640px); height: auto;
        min-height: 0; border-radius: 24px;
    }
    .left { width: 100%; height: auto; position: relative; padding: 38px 32px; }
    .left-inner { width: min(100%, 460px); }
    .right { width: 100%; padding: 32px 28px; overflow: visible; }
    .form-row { flex-direction: column; gap: 0; }
    .password-checklist { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    /* Match the login page: keep a visible background frame around the card. */
    body { padding: 12px; background: var(--bg); }
    .bg-blob { filter: blur(64px); opacity: 0.24; }
    .bg-blob-1 { width: 280px; height: 280px; top: -120px; left: -140px; }
    .bg-blob-2 { width: 240px; height: 240px; bottom: -90px; right: -130px; }

    .wrapper {
        width: 100%; max-width: 480px; margin: 0 auto;
        border-radius: 20px;
        box-shadow: 0 20px 50px rgba(106,17,203,0.13), 0 6px 18px rgba(0,0,0,0.05);
    }
    .left { padding: 30px 20px 28px; }
    .left-icon { width: 58px; height: 58px; margin-bottom: 14px; border-radius: 17px; font-size: 25px; }
    .left h1 { font-size: 21px; }
    .left-divider { margin-bottom: 14px; }
    .left p { margin-bottom: 18px; }
    .left-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 12px; margin-bottom: 20px; }
    .left-steps li { align-items: flex-start; gap: 7px; margin: 0; font-size: 11.5px; line-height: 1.35; }
    .left-steps li i { width: 20px; height: 20px; font-size: 11px; }
    .btn-login { padding: 10px 24px; font-size: 13px; }

    .right { padding: 28px 16px 36px; }
    .right-header { margin-bottom: 20px; }
    .right-header h2 { font-size: 24px; }
    .right-header p { font-size: 13px; line-height: 1.5; }
    .section-header { margin-top: 22px; }
    .input-group { margin-bottom: 13px; }
    .input-wrap input,
    .input-wrap select,
    .input-wrap textarea { min-height: 46px; padding: 12px 14px 12px 40px; font-size: 16px; }
    .input-wrap select { padding-right: 30px; }
    .input-label { font-size: 12px; }
    .file-label { padding: 13px; align-items: flex-start; line-height: 1.45; }
    .file-preview { padding: 10px; }
    .file-preview-info { min-width: 120px; }
    .file-reupload-btn { width: 100%; justify-content: center; }
    .register-btn { min-height: 50px; margin-top: 16px; }
}

@media (max-width: 360px) {
    .left-steps { grid-template-columns: 1fr; }
    .left h1 { font-size: 20px; }
    .right { padding-left: 14px; padding-right: 14px; }
    .password-checklist { padding: 9px; }
    .check-item { font-size: 11px; }
}


/* =========================================================
   SAME LOOK AS THE LOGIN PAGE
   Back to Home pill, clinic logo/name, and (on phones) a short purple header
   with the form on a white sheet with rounded top corners right under it.
   Keep this block LAST so it wins over the earlier rules.
   ========================================================= */

/* ===== BACK TO HOME (top-left fixed) ===== */
.back-home {
    position: fixed;
    top: 20px;
    left: 24px;
    z-index: 100;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 20px;
    border-radius: 30px;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    border: 1.5px solid rgba(106,17,203,0.18);
    color: var(--purple-dark);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: 0.3s;
    box-shadow: 0 4px 14px rgba(106,17,203,0.1);
}

.back-home:hover {
    background: var(--purple-dark);
    color: white;
    border-color: var(--purple-dark);
    box-shadow: 0 6px 20px rgba(106,17,203,0.3);
    transform: translateX(-2px);
}

.back-home i { font-size: 16px; }

/* ===== Clinic logo / name in the purple panel ===== */
.left-icon img {
    width: 100%; height: 100%;
    object-fit: contain;
    border-radius: 18px;
    background: #fff;
}

.left-clinic {
    display: block;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    opacity: 0.78;
    margin: -6px auto 10px;
}

.mobile-login { display: none; }

@media (max-width: 768px) {
    body {
        padding: 0;
        align-items: flex-start;
        background: var(--white);
    }

    .bg-blob { display: none; }

    .wrapper {
        width: 100%;
        max-width: 520px;
        min-height: 100vh;
        min-height: 100dvh;
        margin: 0 auto;
        border-radius: 0;
        box-shadow: none;
        background: var(--white);
    }

    /* ----- Purple header ----- */
    .left {
        width: 100%;
        padding: 68px 24px 54px;      /* top space is for the Back to Home pill */
        flex-shrink: 0;
    }

    .left-inner { display: flex; flex-direction: column; align-items: center; width: 100%; }

    .left-icon {
        width: 54px; height: 54px;
        font-size: 25px;
        margin: 0 auto 12px;
        border-radius: 16px;
        animation: none;
    }
    .left-icon img { border-radius: 14px; }

    .left-clinic { margin: -2px 0 6px; font-size: 10.5px; }

    .left h1 {
        font-size: 20px;
        line-height: 1.3;
        margin: 0;
    }

    /* The divider and the Login button are not needed up here */
    .left-divider,
    .left-question,
    .left .btn-login { display: none; }

    .left p:not(.left-question) {
        margin: 10px 0 0;
        font-size: 13px;
        line-height: 1.5;
        opacity: 0.9;
    }

    /* ----- White form sheet, overlapping the header ----- */
    .right {
        width: 100%;
        flex: 1;
        position: relative;
        margin-top: -26px;
        padding: 30px 18px 28px;
        background: var(--white);
        border-radius: 26px 26px 0 0;
        box-shadow: 0 -8px 24px rgba(106, 17, 203, 0.10);
        overflow: visible;
    }

    .right-header { margin-bottom: 18px; }
    .right-header h2 { font-size: 24px; }

    /* Login link under the form */
    .mobile-login {
        display: block;
        margin-top: 22px;
        text-align: center;
        font-size: 13.5px;
        color: var(--text-muted);
    }

    .mobile-login a {
        color: var(--purple-dark);
        font-weight: 600;
        text-decoration: none;
        padding: 6px 2px;
    }

    .mobile-login a:active { text-decoration: underline; }

    /* Back to Home pill sits on the purple header */
    .back-home {
        top: 14px;
        left: 14px;
        padding: 7px 15px;
        font-size: 12px;
        background: rgba(255, 255, 255, 0.92);
    }

    /* Room for the phone's bottom bar */
    .right { padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 360px) {
    .left { padding: 62px 16px 50px; }
    .left h1 { font-size: 18px; }
    .right { padding-left: 14px; padding-right: 14px; }
    .right-header h2 { font-size: 22px; }
}

/* =========================================================
   PHONES: SHORTER REGISTER PAGE
   Smaller header, and short paired fields (names, birthdate/age,
   gender/civil status) sit side by side so the form is not so long.
   Keep this block LAST.
   ========================================================= */
@media (max-width: 768px) {
    .left { padding: 58px 20px 42px; }
    .left-icon { width: 46px; height: 46px; font-size: 22px; margin-bottom: 8px; border-radius: 14px; }
    .left h1 { font-size: 18px; }
    .left p:not(.left-question) { margin: 8px 0 0; font-size: 13px; }

    .right { margin-top: -22px; padding-top: 22px; }
    .right-header { margin-bottom: 12px; }
    .right-header h2 { font-size: 22px; }
    .right-header p { font-size: 12.5px; margin-top: 2px; }

    .section-header { margin: 14px 0 10px; padding-bottom: 8px; }
    .input-group { margin-bottom: 11px; }

    /* Step 1 + 2: pairs side by side (icons hidden to make room) */
    .wizard-step[data-step="1"] .form-row { flex-direction: row; gap: 10px; }
    .wizard-step[data-step="1"] .form-row .input-group { min-width: 0; }
    .wizard-step[data-step="1"] .form-row .input-icon { display: none; }
    .wizard-step[data-step="1"] .form-row .input-wrap input,
    .wizard-step[data-step="1"] .form-row .input-wrap select { padding-left: 13px; }
    .wizard-step[data-step="1"] .form-row .input-wrap select { padding-right: 28px; }
}

/* Required-field asterisk */
.input-label .req { color: #dc2626; font-weight: 700; margin-left: 1px; }