/* aiSanchaya eForms - Main Stylesheet */

:root {
    --bg-color: #E6F2FF;
    --primary: #0066CC;
    --text: #1F2937;
    --accent: #E5E7EB;
    --error: #EF4444;
    --success: #10B981;
    --green-accent: #10B981;
    --border: #B3D9FF;
    --white: #FFFFFF;
    --gray-text: #6B7280;
    --light-blue: #E6F2FF;
    --blue-heading: #0066CC;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.form-page {
    padding-top: 140px; /* Add padding to account for fixed header */
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 1rem;
    flex: 1;
}

.card {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    text-align: center;
}

.title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--blue-heading);
    text-align: center;
    margin-bottom: 0.5rem;
}

.logo-container {
    text-align: center;
    margin: 0 auto 1.5rem auto;
    display: inline-block;
    width: 280px;
    vertical-align: top;
}

.logo-container .main-logo {
    width: 100%;
    max-width: 280px;
    max-height: 140px;
    height: auto;
    object-fit: contain;
    margin-bottom: 0;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.logo-container .initiative-text {
    font-size: 0.65rem;
    color: var(--gray-text);
    text-align: right;
    margin-top: 0;
    margin-bottom: 0;
    width: 100%;
    line-height: 1.2;
    white-space: nowrap;
}

.main-logo {
    max-width: 280px;
    max-height: 140px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin-bottom: 0.5rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.logo-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--blue-heading);
    text-align: center;
    margin: 0;
    margin-top: 0.5rem;
}

.initiative-text {
    font-size: 0.875rem;
    color: var(--gray-text);
    text-align: center;
    margin-top: 0.5rem;
    margin-bottom: 0;
    max-width: 280px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.2;
    white-space: nowrap;
}

.initiative-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.initiative-link:hover {
    color: #0052A3;
    text-decoration: underline;
}

.subtitle {
    text-align: center;
    color: var(--gray-text);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.form-group .required {
    color: var(--error);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-text);
}

.code-input {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: 'Courier New', monospace;
    font-size: 1.25rem;
    text-align: center;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
    font-family: inherit;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: #0052A3;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: var(--white);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: var(--light-blue);
    border-color: var(--primary);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-block {
    width: 100%;
}

.btn-success {
    background-color: var(--green-accent);
    color: white;
}

.btn-success:hover {
    background-color: #0D9968;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.alert-error {
    background-color: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

.alert-inline {
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
    margin-bottom: 0;
    font-size: 0.875rem;
}

.alert-form {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    margin-top: 0;
}

.field-error {
    border-color: var(--error) !important;
    background-color: #FEE2E2;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.alert-success {
    background-color: #D1FAE5;
    color: #065F46;
    border: 1px solid #6EE7B7;
}

.code-form {
    margin-top: 2rem;
    text-align: left;
}

/* Form Header */
.form-header-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--white);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    padding: 1rem;
    box-shadow: var(--shadow);
}

.form-header {
    max-width: 1200px;
    margin: 0 auto;
}

.form-header-logos {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.aisanchaya-logo-section {
    display: inline-block;
    vertical-align: top;
    width: 120px;
    max-width: 120px;
    flex-shrink: 0;
    flex-grow: 0;
}

.aisanchaya-logo-section img.logo.logo-aisanchaya {
    display: block;
    max-width: 120px;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin-bottom: 0;
}

.aisanchaya-logo-section .spv-initiative-text {
    display: block;
    text-align: right;
    white-space: nowrap;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

.logo {
    max-height: 60px;
    max-width: 120px;
    object-fit: contain;
}

.logo-aisanchaya {
    max-height: 60px;
    max-width: 120px;
}

.spv-initiative-text {
    font-size: 0.65rem;
    color: var(--gray-text);
    margin: 0;
    line-height: 1.2;
}

.spv-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.spv-link:hover {
    color: #0052A3;
    text-decoration: underline;
}

.form-header-text {
    font-size: 0.875rem;
    color: var(--gray-text);
    margin: 0;
    line-height: 1.4;
}

/* Form Page */
.form-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
    color: var(--blue-heading);
}

.form-description {
    color: var(--gray-text);
    margin-bottom: 2rem;
    text-align: left;
}

.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-label,
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
}

.radio-label input[type="radio"],
.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.form-actions {
    margin-top: 2rem;
    text-align: center;
}

/* Success Page */
.success-card {
    text-align: center;
}

.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--green-accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 0 auto 1.5rem;
    font-weight: bold;
}

.success-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.success-message {
    font-size: 1.125rem;
    color: var(--gray-text);
    margin-bottom: 0.5rem;
}

.form-name {
    color: var(--text);
    font-weight: 500;
    margin-bottom: 2rem;
}

/* Footer */
.site-footer {
    background-color: var(--white);
    border-top: 1px solid var(--border);
    padding: 1rem 2rem;
    margin-top: auto;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
    width: 100%;
    display: block;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--gray-text);
}

.footer-left {
    flex: 0 0 auto;
}

.footer-left a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-left a:hover {
    color: #0052A3;
    text-decoration: underline;
}

.footer-right {
    flex: 1 1 auto;
    text-align: right;
}

.footer-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
}

.footer-link:hover {
    color: #0052A3;
    text-decoration: underline;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background-color: var(--white);
    margin: auto;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--blue-heading);
}

.modal-close {
    color: var(--gray-text);
    font-size: 2rem;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
    user-select: none;
}

.modal-close:hover,
.modal-close:focus {
    color: var(--text);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    line-height: 1.8;
}

.modal-body h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--blue-heading);
    margin-bottom: 1rem;
    margin-top: 0;
}

.modal-body h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.modal-body h3:first-of-type {
    margin-top: 1.5rem;
}

.modal-body h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
}

.modal-body p {
    margin-bottom: 1rem;
    color: var(--text);
    line-height: 1.8;
}

.modal-body p:last-child {
    margin-bottom: 0;
}

.modal-body a {
    color: var(--primary);
    text-decoration: none;
}

.modal-body a:hover {
    text-decoration: underline;
}

.modal-body .effective-date {
    color: var(--gray-text);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.modal-body ul.policy-list {
    margin: 1rem 0 1.5rem 2rem;
    padding-left: 0;
    list-style-type: disc;
}

.modal-body ul.policy-list li {
    margin-bottom: 0.75rem;
    color: var(--text);
    line-height: 1.6;
    padding-left: 0.5rem;
}

.modal-body h4 {
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .title {
        font-size: 1.5rem;
    }
    
    .form-header-wrapper {
        padding: 0.75rem;
    }
    
    .form-header-logos {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .aisanchaya-logo-section {
        width: 100%;
    }
    
    .logo {
        max-height: 50px;
        max-width: 100px;
    }
    
    .logo-aisanchaya {
        max-height: 50px;
        max-width: 100px;
    }
    
    .spv-initiative-text {
        font-size: 0.65rem;
    }
    
    .form-header-text {
        font-size: 0.75rem;
    }
    
    body.form-page {
        padding-top: 160px; /* More padding on mobile for taller header */
    }
    
    .site-footer {
        padding: 1rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .footer-right {
        text-align: center;
    }
    
    .modal-content {
        max-height: 95vh;
        margin: 0.5rem;
    }
    
    .modal-header {
        padding: 1rem 1.5rem;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-body h2 {
        font-size: 1.5rem;
    }
    
    .modal-body h3 {
        font-size: 1.125rem;
    }
}

