/* =========================================
   EXCLUSIVE ACCESS SCHEDULER - STYLE.CSS
   Vibe: Fintech, High-End, Clinical White
   Status: RESTORED + ALIGNMENT FIX
   ========================================= */

/* --- MODAL OVERLAY --- */
#eas-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    z-index: 999999;
    display: flex; justify-content: center; align-items: center;
    padding: 10px; box-sizing: border-box;
    opacity: 0; transition: opacity 0.3s ease;
}

/* --- MODAL WRAPPER --- */
.eas-modal-wrap {
    width: 100%; max-width: 700px;
    background: #ffffff;
    box-shadow: 0 25px 60px rgba(0,0,0,0.12);
    border-radius: 12px; border: 1px solid #f1f5f9;
    position: relative; max-height: 95vh;
    overflow-y: auto; overflow-x: hidden;
	transition: box-shadow 0.3s ease;
}
#eas-modal-overlay.open { opacity: 1; }

/* --- CLOSE BUTTON --- */
#eas-close-btn {
	position: sticky; top: 12px; right: 12px;
	float: right; margin: 12px 12px 0 0;
	width: 40px; height: 40px;
    background: #f8fafc !important; border-radius: 50% !important;
    border: 1px solid #e2e8f0 !important;
    display: flex; align-items: center; justify-content: center;
	font-size: 22px; line-height: 1; cursor: pointer; color: #64748b;
    z-index: 50; padding: 0 !important; margin: 0 !important;
    transition: all 0.2s;
	touch-action: manipulation;
}
#eas-close-btn:hover { background: #eff6ff !important; color: #2563EB; border-color: #dbeafe !important; }
#eas-close-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,0.25); }

/* --- CONTAINER --- */
.eas-container {
    padding: 40px 50px 50px 50px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #0f172a;
    box-sizing: border-box;
}
.eas-container * { box-sizing: border-box; } 

/* LOGO */
.eas-logo {
    max-width: 70px !important; 
    height: auto;
    display: block; 
    margin: 0 auto 20px auto;
}

/* TEXT */
.eas-header-group { margin-bottom: 25px; border-bottom: 1px solid #f1f5f9; padding-bottom: 20px; }
.eas-container h2 {
    font-size: 24px; font-weight: 800; margin: 0 0 8px 0; color: #0f172a;
    line-height: 1.2;
}
.eas-subtitle { color: #64748b; font-size: 15px; margin: 0; line-height: 1.5; }

/* PROGRESS BAR */
.eas-progress-bar {
	position: sticky; top: 0; left: 0; right: 0;
	height: 4px; background: #f1f5f9; border-radius: 0;
	margin: 0;
	z-index: 1; /* Sits below close button */
	border-top-left-radius: 12px; border-top-right-radius: 12px;
}
.eas-progress-fill { height: 100%; background: #2563EB; transition: width 0.4s ease; }
.eas-container.has-progress { padding-top: 25px; }

/* --- FORMS (With Alignment Fix) --- */
.eas-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
	gap: 20px; 
	align-items: stretch; /* ensure both columns share the tallest height in the row */
	margin-bottom: 20px; /* add separation below grid rows so next field (e.g., email) isn't tight */
}

/* THE ALIGNMENT FIX: */
.eas-grid .eas-field-group {
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* This forces text to bottom of label area */
    height: 100%; 
}

.eas-label { 
	display: flex; align-items: flex-end; /* keep label baseline consistent */
	font-weight: 600; margin-bottom: 8px; 
	font-size: 13px; color: #334155; text-transform: uppercase; letter-spacing: 0.5px; 
	min-height: 32px; /* give labels a consistent block height to prevent long labels from pushing controls down */
}

/* Non-grid fields */
.eas-field-group { margin-bottom: 25px; } 

.eas-container input, .eas-container select {
    width: 100%; padding: 12px 14px; margin: 0; 
    border: 1px solid #cbd5e1; border-radius: 6px;
    font-size: 15px; background: #fff; color: #0f172a;
    height: auto !important; min-height: 45px; box-shadow: none;
}
.eas-container input:focus, .eas-container select:focus {
    border-color: #2563EB; outline: none; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* --- BUTTONS --- */
.eas-btn {
    width: 100%; padding: 16px;
    background: #0f172a !important; color: #fff !important; 
    border: none !important; border-radius: 8px !important;
    font-size: 16px !important; font-weight: 600 !important;
    cursor: pointer; margin-top: 10px;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: background 0.2s;
}
.eas-btn:hover { background: #1e293b !important; }
.eas-btn-secondary {
    background: transparent !important; color: #64748b !important;
    border: none !important; padding: 10px !important; cursor: pointer;
}
.eas-btn-secondary:hover { color: #0f172a !important; text-decoration: underline; }

/* --- CALENDAR --- */
.eas-cal-container {
    display: grid; grid-template-columns: 1.4fr 0.6fr; gap: 30px; 
    min-height: 340px;
}
.eas-cal-left { border-right: 1px solid #f1f5f9; padding-right: 20px; }
.eas-cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.eas-month-label { font-size: 18px; font-weight: 700; color: #0f172a; }

.eas-cal-nav {
    background: transparent !important; border: 1px solid #e2e8f0 !important;
    border-radius: 4px !important; width: 32px !important; height: 32px !important;
    padding: 0 !important; margin-left: 5px !important;
    color: #64748b !important; font-size: 18px !important;
    display: inline-flex !important; justify-content: center; align-items: center;
}
.eas-cal-grid {
    display: grid !important; grid-template-columns: repeat(7, 1fr) !important; 
    gap: 8px !important; text-align: center;
}
.eas-day-name { font-size: 12px; font-weight: 700; color: #94a3b8; text-transform: uppercase; padding-bottom: 10px; text-align: center; }

.eas-day-btn {
    background: transparent !important; border: none !important;
    padding: 0 !important; margin: 0 !important; border-radius: 50% !important;
    width: 100% !important; aspect-ratio: 1 / 1;
    display: flex !important; align-items: center; justify-content: center;
    font-size: 14px !important; font-weight: 500 !important; color: #334155 !important;
    cursor: pointer;
}
.eas-day-btn:hover:not(:disabled) { background-color: #eff6ff !important; color: #2563EB !important; }
.eas-day-btn.selected { background-color: #2563EB !important; color: #ffffff !important; font-weight: 700 !important; }
.eas-day-btn:disabled { color: #e2e8f0 !important; cursor: default; }

/* --- TIME SLOTS --- */
.eas-slots-col {
	overflow: visible; padding-right: 0;
    display: grid; grid-template-columns: 1fr 1fr; gap: 15px; 
	align-content: start; max-height: none;
}
.eas-time-btn {
    display: flex; justify-content: center; align-items: center; width: 100%;
    padding: 12px; margin: 0 !important; background: #ffffff !important; 
    border: 1px solid #e2e8f0 !important; border-radius: 8px !important;
    color: #334155 !important; font-size: 14px !important; font-weight: 500 !important;
    cursor: pointer;
}
.eas-time-btn:hover { border-color: #2563EB !important; color: #2563EB !important; background: #eff6ff !important; transform: translateY(-1px); }

/* --- SUCCESS / TICKET --- */
.eas-success-wrapper { padding: 10px 0; }
.eas-svg-icon { width: 64px; height: 64px; margin-bottom: 15px; display: inline-block; }

.eas-ticket {
    background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: 8px; padding: 25px; text-align: left;
    border-left: 5px solid #2563EB; 
    margin: 30px 0;
}
.eas-ticket-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 14px; border-bottom: 1px dashed #cbd5e1; padding-bottom: 8px; }
.eas-ticket-row:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.eas-ticket-label { color: #64748b; font-weight: 500; text-transform: uppercase; font-size: 11px; }
.eas-ticket-val { font-weight: 700; color: #0f172a; }

/* --- MOBILE OPTIMIZATION --- */
@media (max-width: 650px) {
    .eas-modal-wrap { width: 95%; max-height: 90vh; border-radius: 16px; }
    .eas-container { padding: 25px 20px 30px 20px; }
    
    .eas-logo { max-width: 50px !important; margin-bottom: 15px; }
    .eas-progress-bar { margin-top: 15px; margin-bottom: 25px; }
    #eas-close-btn { top: 12px; right: 12px; width: 28px; height: 28px; font-size: 18px; }

    .eas-header-group { margin-bottom: 20px; padding-bottom: 15px; }
    .eas-container h2 { font-size: 22px; }

    /* Default to stack */
    .eas-grid { grid-template-columns: 1fr; gap: 0; } 
    
    /* Specific side-by-side override */
    .mobile-split { 
        grid-template-columns: 1fr 1fr !important; 
        gap: 15px !important; 
        align-items: end; /* Fixes alignment on mobile too */
    }
	
	/* Slightly reduce label block on small screens to save space while keeping alignment */
	.eas-label { min-height: 26px; }
    
    .eas-field-group { margin-bottom: 20px; }
    .eas-container input, .eas-container select { padding: 10px 12px; font-size: 16px; }

    .eas-cal-container { grid-template-columns: 1fr; gap: 0; min-height: auto; }
    .eas-cal-left { border-right: none; border-bottom: 1px solid #f1f5f9; padding-right: 0; padding-bottom: 20px; margin-bottom: 20px; }
    .eas-day-btn { font-size: 14px !important; }
    
	.eas-slots-col { 
		max-height: 180px; 
		overflow-y: auto; 
		-webkit-overflow-scrolling: touch; 
		grid-template-columns: 1fr 1fr 1fr; 
		gap: 8px; 
	}
    .eas-time-btn { padding: 10px 4px; font-size: 13px !important; }
    .eas-slots-empty { padding-top: 10px !important; margin: 0 !important; } 

    .eas-ticket { padding: 15px; margin: 20px 0; }
}