* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.flash-message {
    margin-bottom: 15px;
}
.flash-message .error-msg {
    color: red;
    font-size: 0.9rem;
}

.error-msg.rate-limit-msg {
    color: #9a3412;
    background-color: #fff7ed; 
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #fdba74;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

html,
body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
}

.form-row-spaced {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 6px 0 14px;
}
.remember-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #555;
    cursor: pointer;
    user-select: none;
}
.remember-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #2563eb;
    cursor: pointer;
}

/* ============================================================
   LOGIN WRAPPER: Main layout container
   ============================================================ */
.login-wrapper {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    overflow: hidden;
}

/* Brand Logo Styling */
.main-logo {
    font-size: 32px;
    font-weight: 800;
    text-decoration: none;
    color: #1a79b0;
    letter-spacing: -1px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.main-logo span {
    color: #71b345;
    font-weight: 900;
}

/* ===================================== BRAND ICON: CareMed =====================================  */
.brand-icon-plus {
    position: relative;
    width: 32px;
    height: 32px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 12px;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.brand-icon-plus.sm {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.box {
    position: absolute;
    width: 45%;
    height: 45%;
    border-radius: 20%;
    transition: all 0.2s ease;
        box-shadow: 
        inset 0 2px 4px rgba(255, 255, 255, 0.2), 
        inset 0 -3px 5px rgba(0, 0, 0, 0.1);   
}


.box.blue { 
    background: linear-gradient(135deg, #1C8BC9 0%, #1A79B0 100%); 
}
.box.green { 
    background: linear-gradient(135deg, #7DC54B 0%, #71B345 100%); 
}



.box.top { 
    top: 0; 
    left: 27.5%; 
    z-index: 2;
}

.box.bottom { 
    bottom: 0; 
    left: 27.5%; 
    z-index: 1; 
}

.box.left { 
    top: 27.5%; 
    left: 0; 
    z-index: 2; 
}

.box.right { 
    top: 27.5%; 
    right: 0; 
    z-index: 1; 
}

.main-logo-dark, .form-logo, .main-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-weight: 800;
}

@media (max-width: 768px) {
    .brand-icon-plus {
        width: 28px;
        height: 28px;
        margin-right: 10px;
    }
    
    .main-logo-dark, .form-logo, .main-logo {
        font-size: 24px; 
    }
}

@media (max-width: 480px) {
    .brand-icon-plus {
        width: 24px;
        height: 24px;
        margin-right: 8px;
    }

    .brand-icon-plus.sm {
        width: 18px;
        height: 18px;
    }
    
    .box {

        box-shadow: 
            inset 0 1px 2px rgba(255, 255, 255, 0.2), 
            inset 0 -1.5px 3px rgba(0, 0, 0, 0.1);
    }
}


/* ===================================== END BRAND ICON: CareMed =====================================  */


/* ==================================== SIDE-VISUAL: Left panel with hero image and branding ==================================== */
.side-visual {
    flex: 1.3;
    background: linear-gradient(
        135deg,
        rgba(0, 35, 71, 0.82), 
        rgba(26, 121, 176, 0.72) 
    ),
    url('../../image/main-hero.avif');
    background-size: cover;
    background-position: center;
    padding: 60px 80px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    color: #ffffff;
}

.nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 40px;
}

.visual-content {
    width: 100%;
    max-width: 600px;
    margin-top: auto;
    margin-bottom: auto;
}

.guest-btn-light {
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 18px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    backdrop-filter: blur(5px);
    transition: 0.3s;
}

.guest-btn-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #71b345; 
}

.visual-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.05;
    margin-bottom: 20px;
    letter-spacing: -1.5px;
    color: #ffffff;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.visual-content p {
    font-size: 1.15rem;
    line-height: 1.6;
    opacity: 0.95;
    margin-bottom: 48px;
}

.badge-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.trust-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 16px 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    backdrop-filter: blur(10px);
    width: fit-content;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.icon-blue {
    font-size: 26px;
    color: #38bdf8;
}
/* ------- end of side-visual ----- */

/* ============================================= SIDE-FORM: Right panel with login/registration forms ============================================ */
.side-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: #ffffff;
    padding: 30px;
    min-width: 0;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: thin;
}

.side-form::-webkit-scrollbar {
    width: 6px;
}

.side-form::-webkit-scrollbar-thumb {
    background-color: #e2e8f0;
    border-radius: 10px;
}

.form-container {
    width: 100%;
    max-width: 520px;
    margin-top: 20px;
}

.form-side-header {
    margin-bottom: 32px;
    border-left: 4px solid #71b345; 
    padding-left: 16px;
    align-self: flex-start;
}

.form-logo {
    text-decoration: none;
    font-weight: 800;
    font-size: 24px;
    color: #1a79b0; 
    letter-spacing: -1px;
    display: block;
    line-height: 1;
}

.form-logo span {
    color: #71b345;
}

.form-tagline {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #71b345; 
    font-weight: 700;
    margin-top: 4px;
}

.form-row {
    display: flex;
    gap: 15px;
}

#signupForm {
    display: none;
}

.header-text {
    margin-bottom: 32px;
}

.side-form h2 {
    font-size: 32px;
    font-weight: 800;
    color: #002347;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.subtitle {
    color: #64748b;
    font-size: 16px;
}

.input-field {
    margin-bottom: 18px;
}

.label-flex {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

label {
    font-size: 14px;
    font-weight: 700;
    color: #002347;
}

.helper-link {
    font-size: 13px;
    color: #1a79b0; 
    text-decoration: none;
    font-weight: 700;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group i {
    position: absolute;
    left: 16px;
    color: #94a3b8;
    width: 20px;
    text-align: center;
}

.input-group .toggle-pass {
    left: auto;
    right: 16px;
    cursor: pointer;
    transition: color 0.2s;
}

.input-group .toggle-pass:hover {
    color: #1a79b0;
}

input {
    width: 100%;
    padding: 14px 15px 14px 48px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    background: #fcfcfc;
    transition: 0.2s;
    font-family: inherit;
}

input:focus {
    outline: none;
    border-color: #1a79b0;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(26, 121, 176, 0.1);
}

.btn-primary {
    width: 100%;
    background: #002347;
    color: #ffffff;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    letter-spacing: 0.5px;
}

.btn-primary:disabled {
    background-color: #94a3b8 !important; 
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-primary:hover {
    background: #1a79b0; 
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 35, 71, 0.15);
}

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

.divider {
    margin: 24px 0;
    display: flex;
    align-items: center;
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.divider span {
    padding: 0 15px;
}

.google-btn {
    width: 100%;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    padding: 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    transition: 0.2s;
}

.google-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.footer-note {
    text-align: center;
    margin-top: 24px;
    color: #64748b;
    font-size: 14px;
}

.footer-note a {
    color: #71b345;
    text-decoration: none;
    font-weight: 800;
    cursor: pointer;
}

.mobile-logo-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}



.main-logo-dark {
    text-decoration: none;
    font-weight: 800;
    font-size: 32px;
    color: #1a79b0; 
    letter-spacing: -1.5px;
}

.main-logo-dark span {
    color: #71b345;
    font-weight: 900;
}

.guest-pill {
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    background: #f1f5f9;
    color: #64748b;
    padding: 6px 14px;
    border-radius: 20px;
}

/* Responsiveness */
@media (max-width: 1100px) {
    .side-visual {
        padding: 40px;
    }

    .visual-content h1 {
        font-size: 3.2rem;
    }
}

@media (max-width: 968px) {
    .login-wrapper {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    .side-visual {
        display: none;
    }

    .side-form {
        width: 100%;
        height: auto;
        overflow-y: visible;
        padding: 40px 20px;
    }

    .form-side-header {
        display: none;
    }

    .mobile-logo-header {
        display: flex;
    }
}

@media (max-width: 480px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* ------------------------ START OF MODAL STYLES ------------------------ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 35, 71, 0.6);
    backdrop-filter: blur(4px);
    display: none; 
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-container {
    background: #ffffff;
    padding: 40px;
    border-radius: 24px;
    width: 90%;
    max-width: 450px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
}

.otp-input-wrapper {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
}

.otp-digit {
    width: 50px;
    height: 60px;
    text-align: center;
    font-size: 24px;
    font-weight: 800;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    padding: 0 !important; 
    transition: all 0.2s ease;
}

.otp-digit:focus {
    border-color: #1a79b0; /* CareMed Blue */
    background: #fff;
    box-shadow: 0 0 0 4px rgba(26, 121, 176, 0.1);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

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

#otpStep .input-field {
    margin-bottom: 15px;
}

#otpStep label {
    font-size: 13px;
    margin-bottom: 5px;
    display: block;
}

@media (max-width: 480px) {
    .modal-container {
        padding: 30px 20px; 
        width: 95%;
        border-radius: 20px;
    }

    .otp-input-wrapper {
        gap: 6px; 
    }

    .otp-digit {
        width: 14%;
        aspect-ratio: 4 / 5; 
        height: auto; 
        font-size: 20px;
        border-radius: 8px;
    }

    .modal-container h2 {
        font-size: 1.25rem;
    }
    .footer-note #resendBtn {
        display: block;
        margin-top: 5px;
        font-size: 13px;
    }

}

@media (max-width: 360px) {
    .otp-input-wrapper {
        gap: 4px;
    }
    
    .otp-digit {
        font-size: 18px;
        border-width: 1px; 
    }
}

/* ----------------- MATCH PASSWORD MESSAGE ------------------------ */

#match-message {
    font-size: 11px;
    font-weight: 600;
    position: absolute;
    bottom: -18px; 
    left: 2px;
    display: inline-block;
    min-height: 15px;
}

.btn-save:disabled {
    background-color: #cbd5e1 !important;
    cursor: not-allowed;
    opacity: 0.8;
    transform: none !important;
}

.password-info-text {
    font-size: 12px; 
    color: #666; 
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

#reg-match-message {
    transition: all 0.2s ease;
}

@keyframes scaleUp {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.otp-digit.filled {
    border-color: #10b981;
    background-color: #f0fdf4;
}

.otp-digit.otp-complete {
    border-color: #10b981 !important;
    background-color: #f0fdf4 !important;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
    transition: all 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.otp-digit.otp-error {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
    animation: shake 0.4s ease-in-out; 
    color: #b91c1c;
}

/* ----------------- PASSWORD REQUIREMENTS LIST ------------------------ */

.password-requirements {
    margin-top: 10px;
    margin-bottom: 15px; 
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 8px 12px; 
    padding-left: 2px;
}

.req {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.2;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.req.valid { color: #10b981; }
.req.invalid { color: #ef4444; }

#otpStep .input-field {
    margin-bottom: 12px;
}

@media (max-width: 380px) {
    .password-requirements {
        grid-template-columns: 1fr; 
        gap: 6px;
    }
}

.error-msg {
    color: #dc3545;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 8px;
    margin-left: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: shake 0.4s ease-in-out;
}

.input-field:has(.error-msg) input {
    border-color: #fca5a5 !important;
    background-color: #fffef2; 
}

.input-field:has(.error-msg) i {
    color: #dc2626 !important;
}

.input-group {
    position: relative;
    transition: all 0.3s ease;
}

.input-field:has(.error-msg) .input-group {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.05);
    border-radius: 8px;
}

.success-screen {
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

.success-visual {
    margin-bottom: 24px;
}

.confetti-icon {
    font-size: 64px;
    color: #71b345; /* CareMed Green */
    background: #ecfdf5;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto;
    box-shadow: 0 10px 25px rgba(113, 179, 69, 0.1);
}

.email-highlight {
    color: #1a79b0; /* CareMed Blue */
    font-size: 1.1rem;
    display: block;
    margin-top: 8px;
}

.next-steps-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    text-align: left;
    margin: 30px 0;
}

.next-steps-card h4 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    margin-bottom: 15px;
}

.next-steps-card ul {
    list-style: none;
    padding: 0;
}

.next-steps-card li {
    font-size: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #1e293b;
}

.next-steps-card i {
    color: #71b345; /* CareMed Green bullets */
    font-size: 12px;
}

.btn-primary-outline {
    display: block;
    padding: 14px;
    border: 2px solid #002347;
    color: #002347;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 800;
    transition: 0.3s;
}

.btn-primary-outline:hover {
    background: #002347;
    color: #fff;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}