/* AMCST Registration Form Styles - Matching React Prototype */

/* CSS Variables */
:root {
    --amcst-primary: #308fba;
    --amcst-primary-dark: #267093;
    --amcst-secondary: #daa520;
    --amcst-secondary-dark: #c79419;
    --amcst-text: #1f2937;
    --amcst-text-light: #6b7280;
    --amcst-border: #d1d5db;
    --amcst-bg-light: #f9fafb;
    --amcst-white: #ffffff;
}

/* Reset and Base */
* {
    box-sizing: border-box;
}

.amcst-registration-wrapper {
    min-height: 100vh;
    background-color: #f3f4f6;
}

/* Registration Container - TWO COLUMN LAYOUT */
.amcst-registration-container {
    max-width: 1536px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .amcst-registration-container {
        grid-template-columns: 2fr 1fr; /* Main content (left) and sidebar (right) */
        align-items: start;
    }
}

/* Form Content Area (Left Side) */
.amcst-form-content {
    width: 100%;
}

/* Form Header */
.amcst-form-header {
    background: linear-gradient(135deg, var(--amcst-primary) 0%, var(--amcst-primary-dark) 100%);
    padding: 3rem 2rem;
    text-align: center;
    border-radius: 1rem 1rem 0 0;
    margin-bottom: 0;
    color: white;
}

.amcst-form-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    color: white;
}

.amcst-form-header p {
    font-size: 1.125rem;
    opacity: 0.95;
    margin: 0;
    color: rgba(255, 255, 255, 0.95);
}

/* Form Messages */
#amcst-form-messages {
    margin-bottom: 1.5rem;
}

.amcst-notice {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.amcst-notice-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.amcst-notice-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Form Section Styling */
.amcst-form-section {
    background: var(--amcst-white);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

/* Section headings */
.amcst-section-heading {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.amcst-section-heading-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.amcst-section-heading-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.amcst-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--amcst-text);
}

.amcst-section-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--amcst-primary);
    background: rgba(48, 143, 186, 0.12);
}

.amcst-section-icon svg {
    width: 22px;
    height: 22px;
}

.amcst-section-icon.icon-user {
    background: rgba(218, 165, 32, 0.15);
    color: var(--amcst-secondary);
}

.amcst-section-icon.icon-address {
    background: rgba(48, 143, 186, 0.12);
}

.amcst-section-icon.icon-family {
    background: rgba(42, 157, 143, 0.12);
    color: #2a9d8f;
}

.amcst-section-icon.icon-emergency {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.amcst-section-icon.icon-upload {
    background: rgba(147, 51, 234, 0.12);
    color: #9333ea;
}

.amcst-section-description {
    color: var(--amcst-text-light);
    font-size: 0.875rem;
    margin: 0 0 1.5rem 0;
}

/* Form Grid System */
.amcst-form-grid {
    display: grid;
    gap: 1.5rem;
}

.amcst-form-grid-2 {
    grid-template-columns: 1fr;
}

.amcst-form-grid-3 {
    grid-template-columns: 1fr;
}

.amcst-form-grid-4 {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .amcst-form-grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .amcst-form-grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .amcst-form-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .amcst-form-grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Form Fields */
.amcst-form-group {
    display: flex;
    flex-direction: column;
}

.amcst-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--amcst-text);
    margin-bottom: 0.5rem;
}

.amcst-required {
    color: #ef4444;
}

.amcst-form-input,
.amcst-form-select,
.amcst-form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--amcst-border);
    border-radius: 0.5rem;
    font-size: 1rem;
    color: var(--amcst-text);
    transition: all 0.2s ease;
    background: var(--amcst-white);
}

.amcst-form-input:focus,
.amcst-form-select:focus,
.amcst-form-textarea:focus {
    outline: none;
    border-color: var(--amcst-primary);
    box-shadow: 0 0 0 3px rgba(48, 143, 186, 0.1);
}

.amcst-form-help {
    font-size: 0.75rem;
    color: var(--amcst-text-light);
    margin-top: 0.25rem;
}

/* Password Field Styles */
.amcst-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.amcst-password-wrapper .amcst-form-input {
    padding-right: 48px;
}

.amcst-password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--amcst-text-light);
    transition: color 0.2s ease;
}

.amcst-password-toggle:hover {
    color: var(--amcst-primary);
}

.amcst-password-toggle svg {
    width: 20px;
    height: 20px;
}

/* Password Match Hint */
.amcst-password-match-hint {
    min-height: 18px;
    font-weight: 500;
}

.amcst-password-match-hint.amcst-match {
    color: #10b981 !important;
}

.amcst-password-match-hint.amcst-no-match {
    color: #ef4444 !important;
}

/* Input States */
.amcst-form-input.amcst-input-success {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.amcst-form-input.amcst-input-error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.amcst-form-input.amcst-input-success:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.amcst-form-input.amcst-input-error:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Buttons */
.amcst-btn-primary,
.amcst-btn-secondary {
    padding: 0.875rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.amcst-btn-primary {
    background: linear-gradient(135deg, var(--amcst-primary) 0%, var(--amcst-primary-dark) 100%);
    color: white;
}

.amcst-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(48, 143, 186, 0.3);
}

.amcst-btn-secondary {
    background: var(--amcst-secondary);
    color: white;
}

.amcst-btn-secondary:hover {
    background: var(--amcst-secondary-dark);
    transform: translateY(-1px);
}

.amcst-btn-outline {
    width: 100%;
    background: transparent;
    border: 2px solid #e35e95;
    color: #c8336d;
    font-weight: 600;
    transition: all 0.2s ease;
}

.amcst-btn-outline:hover {
    background: #c8336d;
    color: #fff;
    box-shadow: 0 4px 12px rgba(200, 51, 109, 0.3);
}

.amcst-btn-compact {
    padding: 0.65rem 1.25rem;
}

.amcst-btn-full {
    width: 100%;
}

/* Search section */
.amcst-search-grid {
    align-items: flex-end;
}

/* Search Results */
.amcst-search-results {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--amcst-bg-light);
    border-radius: 0.5rem;
    border: 1px solid var(--amcst-border);
}

/* Search badges */
.amcst-search-success,
.amcst-search-error {
    border-radius: 10px;
    padding: 16px;
    font-size: 0.95rem;
    margin-top: 15px;
}

.amcst-search-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.amcst-search-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.amcst-search-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(6, 95, 70, 0.2);
}

.amcst-search-name {
    font-size: 1.25rem;
    display: block;
    color: #065f46;
}

.amcst-search-status {
    font-size: 0.9rem;
    opacity: 0.85;
}

.amcst-search-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.amcst-search-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    border-bottom: 1px dashed rgba(6, 95, 70, 0.1);
}

.amcst-search-detail-row:last-child {
    border-bottom: none;
}

.amcst-detail-label {
    font-size: 0.85rem;
    color: #374151;
    font-weight: 500;
}

.amcst-detail-value {
    font-size: 0.9rem;
    color: #065f46;
    font-weight: 600;
}

.amcst-status-badge {
    background: rgba(6, 95, 70, 0.15);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.amcst-search-info {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(6, 95, 70, 0.2);
    font-size: 0.85rem;
    color: #6b7280;
    font-style: italic;
}

.amcst-search-detail {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Family Members Section */
#family-members-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.amcst-family-member-item {
    border: 2px solid var(--amcst-border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    background: var(--amcst-bg-light);
}

.amcst-family-member-item .amcst-form-grid {
    margin-bottom: 1rem;
}

.amcst-family-member-item .amcst-form-grid:last-child {
    margin-bottom: 0;
}

/* Age field with auto-calculation hint */
.amcst-family-member-item .family-age::placeholder {
    font-size: 0.85rem;
    color: #9ca3af;
}

/* Family member sensitive fields row styling */
.amcst-family-member-item .amcst-form-grid-2:last-child {
    padding-top: 0.75rem;
    border-top: 1px dashed var(--amcst-border);
    margin-top: 0.5rem;
}

.amcst-family-member-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.amcst-family-member-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--amcst-text);
}

.amcst-btn-remove {
    color: #ef4444;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem;
}

.amcst-btn-remove:hover {
    color: #dc2626;
    text-decoration: underline;
}

/* Photo Upload */
.amcst-photo-upload {
    border: 2px dashed var(--amcst-border);
    border-radius: 0.75rem;
    padding: 3rem;
    text-align: center;
    background: var(--amcst-bg-light);
    transition: all 0.2s ease;
}

.amcst-photo-upload:hover {
    border-color: var(--amcst-primary);
    background: rgba(48, 143, 186, 0.02);
}

.amcst-photo-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--amcst-text-light);
}

.amcst-photo-upload-info p {
    font-size: 0.875rem;
    color: var(--amcst-text-light);
    margin: 0.5rem 0 0 0;
}

/* Form Actions */
.amcst-form-actions {
    margin-top: 2rem;
    text-align: center;
}

.amcst-form-actions .amcst-btn-primary {
    width: 100%;
    padding: 1.25rem 2rem;
    font-size: 1.125rem;
}

/* SIDEBAR (RIGHT SIDE) - STICKY */
.amcst-form-sidebar {
    width: 100%;
}

@media (min-width: 1024px) {
    .amcst-form-sidebar {
        position: sticky;
        top: 2rem;
        max-height: calc(100vh - 4rem);
        overflow-y: auto;
    }
}

/* Sidebar Cards */
.amcst-sidebar-card {
    background: var(--amcst-white);
    border-radius: 1rem;
    padding: 1.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.amcst-sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    color: var(--amcst-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Fee Structure */
.amcst-fee-breakdown {
    display: flex;
    flex-direction: column;
}

.amcst-fee-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--amcst-border);
}

.amcst-fee-item:last-child {
    border-bottom: none;
}

.amcst-fee-item span:first-child {
    color: var(--amcst-text-light);
    font-size: 0.9375rem;
}

.amcst-fee-item span:last-child {
    font-weight: 600;
    color: var(--amcst-text);
    font-size: 1rem;
}

/* Fee Calculation Box */
.amcst-fee-calculation {
    background: rgba(48, 143, 186, 0.05);
    border: 1px solid rgba(48, 143, 186, 0.2);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-top: 1.5rem;
}

.amcst-fee-calculation h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--amcst-primary);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.amcst-fee-calc-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: var(--amcst-text);
}

.amcst-fee-total {
    display: flex;
    justify-content: space-between;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 2px solid var(--amcst-primary);
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--amcst-primary);
}

/* Adult Members Fee Item (dynamically added) */
.amcst-fee-adult-members {
    background: rgba(42, 157, 143, 0.05);
    margin: 0 -0.5rem;
    padding: 1rem 0.5rem;
    border-radius: 0.5rem;
}

.amcst-fee-adult-members span:first-child {
    color: #2a9d8f;
}

.amcst-fee-adult-members span:last-child {
    color: #2a9d8f;
}

/* Fee Note */
.amcst-fee-note {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--amcst-bg-light);
    border-radius: 0.5rem;
    border-left: 3px solid var(--amcst-secondary);
}

.amcst-fee-note p {
    font-size: 0.8125rem;
    color: var(--amcst-text);
    margin: 0 0 0.5rem 0;
    line-height: 1.5;
}

.amcst-fee-note p:last-child {
    margin-bottom: 0;
}

/* Payment Options */
.amcst-payment-methods {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.amcst-payment-methods li {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    background: var(--amcst-bg-light);
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    color: var(--amcst-text);
}

.amcst-sidebar-note {
    font-size: 0.8125rem;
    color: var(--amcst-text-light);
    margin: 1rem 0 0 0;
    line-height: 1.5;
}

/* Need Help Card */
.amcst-sidebar-card:last-child {
    background: linear-gradient(135deg, var(--amcst-primary) 0%, var(--amcst-primary-dark) 100%);
    color: white;
}

.amcst-sidebar-card:last-child .amcst-sidebar-title {
    color: white;
}

.amcst-contact-info {
    color: white;
}

.amcst-contact-info p {
    font-size: 0.9375rem;
    margin: 0 0 0.75rem 0;
    line-height: 1.6;
}

.amcst-contact-info p:first-child {
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Loading Spinner */
.amcst-spinner {
    border: 3px solid rgba(48, 143, 186, 0.1);
    border-top-color: var(--amcst-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive Adjustments */
@media (max-width: 1023px) {
    .amcst-form-header h1 {
        font-size: 2rem;
    }
    
    .amcst-registration-container {
        padding: 2rem 1rem;
    }
    
    .amcst-form-section {
        padding: 1.5rem;
    }
    
    .amcst-sidebar-card {
        padding: 1.5rem;
    }
}

@media (max-width: 767px) {
    .amcst-form-header {
        padding: 2rem 1.5rem;
    }
    
    .amcst-form-header h1 {
        font-size: 1.75rem;
    }
    
    .amcst-form-header p {
        font-size: 1rem;
    }
    
    .amcst-registration-container {
        padding: 1.5rem 1rem;
    }
    
    .amcst-form-section {
        padding: 1.25rem;
    }
    
    .amcst-section-title {
        font-size: 1.125rem;
    }
}
