* {
    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;
}

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

.login-wrapper {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    overflow: hidden;
}

.main-logo {
    font-size: 32px;
    font-weight: 800;
    text-decoration: none;
    color: #ffffff; /* Maintained white for hero overlay */
    letter-spacing: -1.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.main-logo span {
    color: #71b345; /* Updated to CareMed Green */
    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);
    }
}

@media (max-width: 375px) {
    .brand-icon-plus {
        width: 22px;
        height: 22px;
        margin-right: 6px; 
    }

    .main-logo, .main-logo-dark, .form-logo {
        font-size: 20px !important;
        letter-spacing: -0.5px;
    }

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



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

.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; /* Updated to Green */
}

.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;
}

.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; /* Updated to Green */
    padding-left: 16px;
    align-self: flex-start;
}

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

.form-logo span {
    color: #71b345; /* Updated to Green */
}

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

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

.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; /* Updated to Blue */
    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; /* Updated to Blue */
}

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; /* Updated to Blue */
    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:hover {
    background: #1a79b0; /* Updated to Blue */
    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;
    display: flex;
    align-items: center;
}

.main-logo-dark span {
    color: #71b345; /* Updated to Green */
    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; }
}

/* 1. Base Spinner Definition */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    display: inline-block;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

/* 2. Loading State for the Button */
.btn-primary.is-loading {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0.8;
    cursor: not-allowed;
    pointer-events: none;
}

/* 3. Animation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 4. Text Alignment Fix */
.btn-primary.is-loading span {
    pointer-events: none;
    user-select: none;
}

/* ----------------- 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;
}

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

.error-msg::before {
    content: '';
    font-size: 18px;
    line-height: 1;
}

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

.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;
}