/* Import medical-grade fonts for 2025 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@200;300;400;500;600;700&display=swap');

:root {
    /* Light Calm Off-White Magnetic Transparent Palette */
    --glass-primary: rgba(254, 254, 254, 0.75);
    --glass-secondary: rgba(249, 250, 251, 0.65);
    --glass-tertiary: rgba(248, 249, 250, 0.45);
    --glass-border: rgba(203, 213, 225, 0.25);
    --glass-border-hover: rgba(148, 163, 184, 0.35);
    --glass-shadow: rgba(100, 116, 139, 0.08);
    --glass-shadow-hover: rgba(79, 195, 247, 0.12);
    
    /* Medical Professional Colors */
    --accent-medical: #06D6A0;
    --accent-medical-light: #06D6A0;
    --accent-success: #059669;
    --accent-warm: #f59e0b;
    
    /* Text Colors - Calm and Professional */
    --text-primary: #334155;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --text-hint: #cbd5e1;
    --text-white: #ffffff;
    
    /* Background Gradients */
    --bg-overlay: rgba(248, 250, 252, 0.85);
    --bg-gradient-light: linear-gradient(135deg, rgba(254, 254, 254, 0.9) 0%, rgba(248, 250, 252, 0.85) 100%);
    --bg-gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.85) 0%, rgba(249, 250, 251, 0.75) 100%);
    
    /* Input and Button Styles */
    --input-bg: rgba(255, 255, 255, 0.85);
    --input-bg-focus: rgba(255, 255, 255, 0.95);
    --button-primary: #B3BFB8;
    --button-primary-hover: linear-gradient(135deg, #0891b2, #0e7490);
    --button-secondary: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    --button-secondary-hover: linear-gradient(135deg, #cbd5e1, #94a3b8);
    
    /* Magnetic Effects */
    --magnetic-glow: rgba(6, 182, 212, 0.15);
    --magnetic-border: rgba(6, 182, 212, 0.25);
    --magnetic-shadow: 0 8px 32px rgba(6, 182, 212, 0.15);
}

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

/* Modal Overlay - Light Transparent */
.medregister {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-overlay);
    backdrop-filter: blur(12px) saturate(180%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1.5rem;
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    animation: overlayFadeIn 0.4s ease-out;
}

/* Background Elements - Subtle Light Floating Shapes */
.bg-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    background: var(--glass-secondary);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    opacity: 0.6;
    animation: gentleFloat 20s ease-in-out infinite;
}

.shape-1 {
    width: 100px;
    height: 100px;
    top: 8%;
    left: -30px;
    animation-delay: 0s;
}

.shape-2 {
    width: 60px;
    height: 60px;
    top: 70%;
    right: -20px;
    animation-delay: -10s;
}

.shape-3 {
    width: 40px;
    height: 40px;
    bottom: 20%;
    left: 10%;
    animation-delay: -5s;
}

/* Modal Content Container */
.modal-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Prevent it from growing */
    flex-grow: 0; /* Prevent it from growing */
    /* Revert pointer-events to default, as it should not block clicks on its own content */
    /* The click should only register on the modal overlay if it's outside the card */
}

/*
 * INLINE FIX: The outer container. This is the ONLY element that scrolls.
 * It has the border and radius, but is FORCED to have ZERO padding.
 */
 .registration-card {
    background: var(--bg-gradient-card);
    backdrop-filter: blur(24px) saturate(200%);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    box-shadow: 0 24px 48px var(--glass-shadow), 0 8px 16px rgba(6, 182, 212, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    width: min(500px, 90vw);
    height: min(90vh, 720px);
    max-height: 90vh;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    animation: magneticGlow 8s ease-in-out infinite alternate;
    pointer-events: auto; /* Re-enable pointer events for the card content */

    /* INLINE: CRITICAL SCROLL PROPERTIES, FORCED WITH !important */
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 0 !important;
}

/*
 * INLINE FIX: The inner container that holds the content.
 * This element gets the padding. It MUST NOT be scrollable.
 */
#registration-content {
    width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;

    /* INLINE: MOVE ALL PADDING HERE, FORCED WITH !important */
    padding: clamp(1.5rem, 5vw, 2.5rem) !important;
    gap: 1rem;
}

/*
 * INLINE FIX: FORCE a reset on ALL inner "step" containers.
 * This is the crucial part that removes the conflicting scrollbar.
 */
#registration-step,
.otp-verification-container,
.registration-success {
    padding: 0 !important;
    margin: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important; /* Force NO scrolling on inner elements */
    
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allows the content to fill the space vertically */
}

/*
 * INLINE FIX: This styling now correctly applies ONLY to .registration-card.
 */
.registration-card::-webkit-scrollbar {
    width: 8px; /* Slightly thicker for better usability */
}

.registration-card::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 0 28px 28px 0; /* Match parent border-radius */
}

.registration-card::-webkit-scrollbar-thumb {
    background: var(--glass-border-hover);
    border-radius: 4px; 
    border: 2px solid transparent; /* Creates padding around the thumb */
    background-clip: content-box;
}

.registration-card::-webkit-scrollbar-thumb:hover {
    background: var(--magnetic-border);
}


/* Typography - Light Elegant */
.main-title {
    font-size: 1.85rem;
    font-weight: 700;
    color: #06D6A0;
    margin-bottom: 0.75rem;
    background: #06D6A0;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    flex-shrink: 0;
    letter-spacing: -0.025em;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.75rem;
    line-height: 1.6;
    font-weight: 400;
    flex-shrink: 0;
    opacity: 0.9;
}

/* Benefits Section - Light Scrollable */
.benefits-section {
    text-align: left;
    margin-bottom: 1.75rem;
    padding: clamp(1rem, 3vw, 1.5rem); /* Responsive padding for benefits section */
    background: var(--glass-primary);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    
    /* Scrollable with Height Constraint */
    max-height: clamp(120px, 25vh, 220px); /* More flexible max-height for benefits */
    overflow-y: auto;
    flex-shrink: 1;
    
    /* Light Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border-hover) transparent;
}

.benefits-section::-webkit-scrollbar {
    width: 4px;
}

.benefits-section::-webkit-scrollbar-thumb {
    background: var(--glass-border-hover);
    border-radius: 2px;
}

.benefits-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-align: center;
    letter-spacing: -0.01em;
}

.benefit-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.85rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.benefit-item:last-child {
    margin-bottom: 0;
}
#registration-step {
    padding: 0rem 0rem; /* Was likely too large, e.g., 4rem 2rem */
    max-height: 90vh;     /* CRITICAL: Constrains the modal's height */
    overflow-y: auto;     /* Ensures content is scrollable if it exceeds max-height */
}


/* Close Button - Light Magnetic */
.close-button {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.3rem;
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
    z-index: 10;
    font-weight: 300;
}

.close-button:hover {
    background: var(--glass-secondary);
    color: var(--text-primary);
    transform: scale(1.08);
    box-shadow: var(--magnetic-shadow);
    border-color: var(--magnetic-border);
}



.benefit-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #B3BFB8;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.85rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.2);
}

.benefit-icon::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: 700;
}

/* Form Styles - Light Magnetic */
.registration-form {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: auto;
    flex-shrink: 0;
}

.form-group {
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
    letter-spacing: -0.01em;
}

.form-input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 10px 20px;
    font-size: 16px;
    color: var(--text-primary);
    outline: none;
    backdrop-filter: blur(12px);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 400;
}

.form-input:focus {
    border-color: var(--magnetic-border);
    box-shadow: 
        0 0 0 3px var(--magnetic-glow),
        var(--magnetic-shadow);
    transform: translateY(-1px);
    background: var(--input-bg-focus);
}

.form-input::placeholder {
    color: var(--text-hint);
    font-weight: 300;
}

/* Submit Button - Light Magnetic */
.submit-button {
    background: transparent;
    color: var(--text-white);
    border: none;
    border-radius: 18px;
    padding: 18px 26px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    margin-top: 0.75rem;
    letter-spacing: -0.01em;
}

.submit-button:hover {
    background: transparent;
    transform: translateY(-2px);
    box-shadow: var(--magnetic-shadow);
}

.submit-button:active {
    transform: translateY(0);
}

.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Magnetic Ripple Effect */
.submit-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: all 0.6s ease;
}

.submit-button:active::after {
    width: 300px;
    height: 300px;
}

/* OTP Verification - Light Theme */
.otp-verification-container {
    text-align: center;
    animation: slideInUp 0.5s ease-out;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.otp-header {
    margin-bottom: 1.75rem;
    flex-shrink: 0;
}

.otp-header h3 {
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.85rem;
    background: var(--button-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.025em;
}

.otp-header p {
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

.email-display {
    color: var(--accent-medical);
    font-weight: 600;
    font-size: 1.05rem;
    background: var(--glass-primary);
    padding: 0.85rem 1.5rem;
    border-radius: 16px;
    display: inline-block;
    margin: 0.85rem 0;
    border: 1px solid var(--magnetic-border);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 12px var(--magnetic-glow);
}

/* OTP Input - Light Magnetic */
.otp-input-section {
    margin: 1.75rem 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.otp-input-section label {
    display: block;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 1rem;
}

#otp-input {
    width: 280px;
    padding: 1.4rem;
    font-size: 1.8rem;
    text-align: center;
    letter-spacing: 0.4rem;
    border: 2px solid var(--glass-border);
    border-radius: 20px;
    background: var(--input-bg);
    color: var(--text-primary);
    margin: 0 auto;
    display: block;
    outline: none;
    backdrop-filter: blur(16px);
    transition: all 0.35s ease;
    font-weight: 600;
    box-shadow: inset 0 2px 8px rgba(100, 116, 139, 0.05);
}

#otp-input:focus {
    border-color: var(--magnetic-border);
    box-shadow: 
        0 0 0 4px var(--magnetic-glow),
        var(--magnetic-shadow),
        inset 0 2px 8px rgba(100, 116, 139, 0.05);
    background: var(--input-bg-focus);
    transform: scale(1.02);
}

#otp-input::placeholder {
    color: var(--text-hint);
    font-weight: 300;
    letter-spacing: 0.2rem;
}

/* Button Styles - Light Magnetic Theme */
.primary-btn {
    background: var(--button-primary);
    color: var(--text-white);
    border: none;
    border-radius: 16px;
    padding: 16px 30px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0.5rem;
    min-width: 140px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
}

.primary-btn:hover {
    background: var(--button-primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--magnetic-shadow);
}

.primary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.secondary-btn {
    background: var(--button-secondary);
    color: var(--text-secondary);
    border: none;
    border-radius: 16px;
    padding: 16px 30px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0.5rem;
    min-width: 140px;
    box-shadow: 0 2px 8px rgba(100, 116, 139, 0.1);
}

.secondary-btn:hover {
    background: var(--button-secondary-hover);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(100, 116, 139, 0.2);
}

.text-btn {
    background: none;
    border: none;
    color: var(--accent-medical);
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.9rem;
    margin-top: 1rem;
    padding: 0.6rem;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.text-btn:hover {
    color: var(--text-primary);
    background: var(--glass-tertiary);
    text-decoration: none;
    transform: translateY(-1px);
}

/* OTP Actions */
.otp-actions {
    margin: 1.75rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    align-items: center;
    flex-shrink: 0;
}

/* OTP Info */
.otp-info {
    margin-top: 1.25rem;
    flex-shrink: 0;
}

.otp-info .note {
    color: var(--text-light);
    font-size: 0.85rem;
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0.8;
}

/* Success Screen - Light Magnetic */
.registration-success {
    text-align: center;
    padding: 2rem 1rem;
    animation: slideInUp 0.5s ease-out;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.success-icon {
    font-size: 3.5rem;
    margin-bottom: 1.75rem;
    animation: bounceIn 0.8s ease-out;
    background: var(--button-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.registration-success h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    background: var(--button-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.025em;
}

.registration-success p {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

.registration-success strong {
    color: var(--accent-success);
    font-weight: 600;
}

/* Security Notice - Light Professional */
.security-notice {
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--glass-primary);
    border: 1px solid rgba(5, 150, 105, 0.2);
    border-radius: 16px;
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.6;
    backdrop-filter: blur(12px);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.05);
}

.security-icon {
    display: inline-block;
    margin-right: 0.6rem;
    color: var(--accent-success);
    font-size: 0.9rem;
}

/* Animations - Light Magnetic Effects */
@keyframes overlayFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(12px) saturate(180%);
    }
}

@keyframes gentleFloat {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
        opacity: 0.6;
    }
    50% { 
        transform: translateY(-15px) rotate(180deg); 
        opacity: 0.8;
    }
}

@keyframes magneticGlow {
    0% { 
        box-shadow: 
            0 24px 48px var(--glass-shadow),
            0 8px 16px rgba(6, 182, 212, 0.05),
            inset 0 1px 0 rgba(255, 255, 255, 0.6);
    }
    100% { 
        box-shadow: 
            0 32px 64px rgba(6, 182, 212, 0.1),
            0 16px 32px rgba(6, 182, 212, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.8);
    }
}

@keyframes lightShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

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

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* INLINE FIX: Force zero padding in ALL media queries */
@media (max-width: 768px) {
    .medregister {
        padding: 1rem;
    }
    
    .registration-card { 
        padding: 0 !important; /* INLINE: Force zero padding on mobile too */
        width: 96vw;
        height: min(65vh, 650px);
        max-height: 65vh;
        border-radius: 24px;
    }
    
    /* INLINE: Adjust inner content padding for mobile */
    #registration-content {
        padding: 1.5rem !important; /* Smaller padding for mobile */
    }
    
    .main-title { 
        font-size: 1.6rem;
        margin-bottom: 0.6rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
    
    .benefits-section { 
        padding: 1.25rem;
        margin-bottom: 1.5rem;
        max-height: 140px;
    }
    
    .benefit-item {
        margin-bottom: 0.75rem;
        font-size: 0.85rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-input {
        padding: 14px 18px;
        font-size: 15px;
    }
    
    .submit-button {
        padding: 16px 22px;
        margin-top: 0.5rem;
    }
    
    #otp-input {
        width: 240px;
        font-size: 1.5rem;
        letter-spacing: 0.3rem;
        padding: 1.2rem;
    }
    
    .security-notice {
        font-size: 0.8rem;
        padding: 0.85rem 1rem;
        margin-top: 1rem;
    }
    
    .floating-shape {
        opacity: 0.3;
    }
}

@media (max-width: 480px) {
    .registration-card {
        height: min(70vh, 600px);
        padding: 0 !important; /* INLINE: Force zero padding on very small screens */
    }
    
    /* INLINE: Adjust inner content padding for very small screens */
    #registration-content {
        padding: 1.25rem !important;
    }
    
    .benefits-section {
        max-height: 120px;
    }
    
    .otp-actions {
        flex-direction: column;
    }
    
    .primary-btn, .secondary-btn {
        width: 100%;
        margin: 0.3rem 0;
    }
}

/* INLINE FIX: Force zero padding in portrait orientation */
@media (orientation: portrait) and (max-height: 600px) {
    .registration-card {
        height: min(75vh, 550px);
        padding: 0 !important; /* INLINE: Force zero padding in portrait */
    }
    
    #registration-content {
        padding: 1rem !important; /* Adjust inner padding for portrait */
    }
    
    .benefits-section {
        max-height: 100px;
    }
}

/* Focus States for Accessibility */
.primary-btn:focus,
.secondary-btn:focus,
.submit-button:focus {
    outline: 2px solid var(--magnetic-border);
    outline-offset: 2px;
}

.form-input:focus,
#otp-input:focus {
    outline: none;
}

.text-btn:focus {
    outline: 2px solid var(--magnetic-border);
    outline-offset: 2px;
    border-radius: 6px;
}

.close-button:focus {
    outline: 2px solid var(--magnetic-border);
    outline-offset: 2px;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}
