/* AHG Security Payment Form Styles */

.ahg-security-payment-form {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.ahg-form-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 40px;
    position: relative;
}

/* ============================================
   PROGRESS BAR - Single Line with Full Coverage
   ============================================ */
.ahg-progress-bar {
    margin-bottom: 40px;
    position: relative;
    overflow-x: auto;
    overflow-y: visible;
    padding: 10px 0 20px 0;
}

.ahg-progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 2px;
    position: relative;
    min-width: 900px;
    padding: 0 10px;
}

/* Progress line that connects ALL steps */
.ahg-progress-steps::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 35px;
    right: 35px;
    height: 3px;
    background: #e5e7eb;
    z-index: 0;
    border-radius: 2px;
}

.ahg-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 0;
    min-width: 55px;
    max-width: 70px;
    position: relative;
    z-index: 1;
    cursor: pointer;
    padding: 0 2px;
    transition: all 0.2s ease;
}

.ahg-step:hover {
    transform: translateY(-2px);
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 6px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.step-label {
    font-size: 10px;
    color: #6b7280;
    text-align: center;
    transition: all 0.3s ease;
    white-space: nowrap;
    line-height: 1.2;
    font-weight: 500;
}

/* Active step */
.ahg-step.active .step-number {
    background: var(--ahg-primary, #22c55e);
    border-color: var(--ahg-primary, #22c55e);
    color: white;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.ahg-step.active .step-label {
    color: var(--ahg-primary, #22c55e);
    font-weight: 700;
}

/* Completed step */
.ahg-step.completed .step-number {
    background: var(--ahg-primary-dark, #16a34a);
    border-color: var(--ahg-primary-dark, #16a34a);
    color: white;
}

.ahg-step.completed .step-number span {
    display: none;
}

.ahg-step.completed .step-number::after {
    content: '✓';
    font-size: 18px;
    font-weight: bold;
}

.ahg-step.completed .step-label {
    color: var(--ahg-primary-dark, #16a34a);
}

/* Clickable states */
.ahg-step {
    cursor: pointer;
    user-select: none;
}

.ahg-step:not(.completed):not(.active) {
    opacity: 0.5;
}

.ahg-step.completed,
.ahg-step.active {
    opacity: 1;
}

/* Hide the old progress line div */
.ahg-progress-line,
.ahg-progress-fill {
    display: none !important;
}

/* Scrollbar styling */
.ahg-progress-bar::-webkit-scrollbar {
    height: 6px;
}

.ahg-progress-bar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.ahg-progress-bar::-webkit-scrollbar-thumb {
    background: var(--ahg-primary, #22c55e);
    border-radius: 3px;
}

/* ============================================
   FORM SCREENS
   ============================================ */
.ahg-form-screen {
    display: none;
    animation: fadeIn 0.3s ease;
}

.ahg-form-screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ahg-form-screen h2 {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 10px 0;
}

.screen-description {
    font-size: 16px;
    color: var(--ahg-secondary);
    margin: 0 0 30px 0;
}

/* Form Groups */
.ahg-form-group {
    margin-bottom: 24px;
}

.ahg-form-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 14px;
}

.ahg-form-group input[type="text"],
.ahg-form-group input[type="email"],
.ahg-form-group input[type="tel"],
.ahg-form-group input[type="number"],
.ahg-form-group select,
.ahg-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--ahg-border);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.ahg-form-group input:focus,
.ahg-form-group select:focus,
.ahg-form-group textarea:focus {
    outline: none;
    border-color: var(--ahg-primary);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.ahg-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Radio and Checkbox Groups */
.ahg-radio-group,
.ahg-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ahg-radio,
.ahg-checkbox {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 2px solid var(--ahg-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ahg-radio:hover,
.ahg-checkbox:hover {
    border-color: var(--ahg-primary);
    background: rgba(34, 197, 94, 0.05);
}

.ahg-radio input[type="radio"],
.ahg-checkbox input[type="checkbox"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.ahg-radio input[type="radio"]:checked + span,
.ahg-checkbox input[type="checkbox"]:checked + span {
    font-weight: 600;
    color: var(--ahg-primary);
}

/* Info Boxes */
.ahg-info-box,
.ahg-warning-box,
.ahg-disclaimer-box {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.6;
}

.ahg-info-box {
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
    color: #1e40af;
}

.ahg-warning-box {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    color: #92400e;
}

.ahg-disclaimer-box {
    background: var(--ahg-bg);
    border: 2px solid var(--ahg-border);
    display: flex;
    align-items: start;
    gap: 12px;
}

.ahg-disclaimer-box input[type="checkbox"] {
    margin-top: 4px;
    width: 20px;
    height: 20px;
}

/* Buttons */
.ahg-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ahg-btn-primary {
    background: var(--ahg-primary);
    color: white;
}

.ahg-btn-primary:hover {
    background: var(--ahg-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.ahg-btn-secondary {
    background: white;
    color: var(--ahg-secondary);
    border: 2px solid var(--ahg-border);
}

.ahg-btn-secondary:hover {
    border-color: var(--ahg-secondary);
    background: var(--ahg-bg);
}

.ahg-btn-success {
    background: #10b981;
    color: white;
}

.ahg-btn-success:hover {
    background: #059669;
}

.ahg-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--ahg-border);
}

/* Property Cards */
.property-card {
    background: var(--ahg-bg);
    border: 2px solid var(--ahg-border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.property-card h3 {
    margin: 0 0 16px 0;
    color: #111827;
    font-size: 18px;
}

/* Guard Post Cards */
.guard-post-card {
    background: white;
    border: 1px solid var(--ahg-border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.guard-post-card h4 {
    margin: 0 0 12px 0;
    color: #374151;
    font-size: 16px;
}

/* Schedule Grid */
.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.day-card {
    background: white;
    border: 2px solid var(--ahg-border);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.day-card:hover {
    border-color: var(--ahg-primary);
}

.day-card.active {
    border-color: var(--ahg-primary);
    background: rgba(34, 197, 94, 0.1);
}

/* Hazard Categories */
.ahg-hazard-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.hazard-category h3 {
    font-size: 18px;
    color: #111827;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--ahg-primary);
}

/* Total Hours Display */
.ahg-total-hours {
    background: var(--ahg-primary);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    font-size: 18px;
    margin-top: 24px;
}

.ahg-total-hours span {
    font-size: 32px;
    font-weight: 700;
    display: block;
    margin-top: 8px;
}

/* Quote Display */
.ahg-quote-container {
    background: var(--ahg-bg);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
}

.quote-section {
    margin-bottom: 32px;
}

.quote-section h3 {
    font-size: 20px;
    color: #111827;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--ahg-border);
}

.quote-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--ahg-border);
}

.quote-item:last-child {
    border-bottom: none;
}

.quote-total {
    background: var(--ahg-primary);
    color: white;
    padding: 24px;
    border-radius: 8px;
    margin-top: 24px;
}

.quote-total .amount {
    font-size: 42px;
    font-weight: 700;
    display: block;
    margin-top: 8px;
}

/* Loading Overlay */
.ahg-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.ahg-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.ahg-loading-overlay p {
    color: white;
    margin-top: 20px;
    font-size: 18px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ahg-form-container {
        padding: 24px 16px;
    }
    
    .ahg-form-row {
        grid-template-columns: 1fr;
    }
    
    .ahg-progress-steps {
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    
    .ahg-step {
        min-width: 60px;
    }
    
    .step-number {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .step-label {
        font-size: 10px;
    }
    
    .ahg-form-screen h2 {
        font-size: 24px;
    }
    
    .ahg-form-actions {
        flex-direction: column;
    }
    
    .ahg-btn {
        width: 100%;
        justify-content: center;
    }
    
    .ahg-hazard-categories {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .ahg-security-payment-form {
        padding: 12px;
    }
    
    .ahg-form-container {
        padding: 20px 12px;
        border-radius: 8px;
    }
    
    .schedule-grid {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .ahg-progress-bar,
    .ahg-form-actions,
    .ahg-btn {
        display: none !important;
    }
    
    .ahg-form-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}


/* Additional Styles for Updated Form */

/* States Grid */
.states-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.state-item {
    margin-bottom: 12px;
}

.state-region {
    margin-bottom: 24px;
    padding: 16px;
    background: var(--ahg-bg);
    border-radius: 8px;
}

.state-region h4 {
    margin: 0 0 16px 0;
    color: #111827;
    font-size: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--ahg-primary);
}

/* Local Jurisdictions */
.local-jurisdictions-container {
    margin-top: 8px;
    padding: 8px;
    background: white;
    border-radius: 4px;
}

.local-jurisdiction-input {
    width: 100% !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    border: 1px solid var(--ahg-border) !important;
    border-radius: 4px !important;
}

.jurisdictions-list {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.jurisdiction-tag {
    display: inline-flex;
    align-items: center;
    background: #e5e7eb;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    color: #374151;
}

.jurisdiction-tag .remove-jurisdiction {
    cursor: pointer;
    margin-left: 6px;
    color: #ef4444;
    font-weight: bold;
    font-size: 14px;
}

.jurisdiction-tag .remove-jurisdiction:hover {
    color: #dc2626;
}

/* Supervisor Info Box */
.supervisor-info {
    background: #f0fdf4;
    border-left: 4px solid var(--ahg-primary);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Bill Category Styling */
.bill-category-info {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 13px;
}

/* Clickable step indicator */
.ahg-step {
    cursor: pointer;
    user-select: none;
}

.ahg-step:not(.completed):not(.active) {
    opacity: 0.5;
    cursor: default;
}

.ahg-step.completed,
.ahg-step.active {
    opacity: 1;
    cursor: pointer;
}

/* Mobile Patrol Hours Info */
.mobile-patrol-info {
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 13px;
}

/* Insurance Options Styling */
.insurance-option-group {
    margin-bottom: 16px;
}

.insurance-option-group h4 {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Quote Details Enhancement */
.quote-details-section {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

.quote-details-section h4 {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 12px 0;
    text-transform: uppercase;
}

.quote-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px dashed var(--ahg-border);
}

.quote-detail-item:last-child {
    border-bottom: none;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .ahg-progress-steps {
        min-width: 850px;
    }
    
    .ahg-step {
        min-width: 50px;
    }
    
    .step-number {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .step-label {
        font-size: 9px;
    }
}

@media (max-width: 768px) {
    .ahg-form-container {
        padding: 20px;
    }
    
    .ahg-progress-bar {
        margin-bottom: 30px;
    }
    
    .ahg-progress-steps {
        min-width: 750px;
    }
    
    .ahg-step {
        min-width: 45px;
        max-width: 50px;
    }
    
    .step-number {
        width: 28px;
        height: 28px;
        font-size: 11px;
        border-width: 2px;
    }
    
    .step-label {
        font-size: 8px;
    }
    
    .ahg-progress-steps::before {
        top: 14px;
        left: 25px;
        right: 25px;
    }
    
    .states-grid {
        grid-template-columns: 1fr;
    }
}

/* Error state for inputs */
.ahg-form-group input.error,
.ahg-form-group select.error,
.ahg-form-group textarea.error {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.error-message {
    color: #dc2626;
    font-size: 13px;
    margin-top: 4px;
}

/* Field notes */
.field-note {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 10px;
    font-style: italic;
}
