/* ==========================================================================
   General & Reset Styles
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    color: #212121;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
    min-height: 100vh;
}

/* ==========================================================================
   Main Layout & Container
   ========================================================================== */
.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: slideUp 0.8s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-container {
    padding: 40px;
}

/* ==========================================================================
   Header & Logo
   ========================================================================== */
.header {
    background: linear-gradient(135deg, #0A2342 0%, #1e3a5f 100%);
    color: white;
    padding: 30px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 169, 157, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.logo-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 8px 20px rgba(0, 169, 157, 0.3);
    background: #fff;
}

.company-info {
    position: relative;
    z-index: 2;
}

.company-name {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
    background: linear-gradient(135deg, #ffffff 0%, #00A99D 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 16px;
    opacity: 0.9;
    font-weight: 300;
    align-items: center;
}

.contact-info {
    margin-top: 15px;
    font-size: 14px;
    opacity: 0.8;
    position: relative;
    z-index: 2;
}

/* ==========================================================================
   Form Components (Title, Sections, Fields)
   ========================================================================== */
.form-title {
    text-align: center;
    margin-bottom: 30px;
}

.form-title h1 {
    font-size: 32px;
    color: #0A2342;
    margin-bottom: 10px;
    font-weight: 700;
}

.form-title h2 {
    font-size: 20px;
    color: #00A99D;
    font-weight: 500;
}

.instructions {
    background: linear-gradient(135deg, #e8f5f3 0%, #d1f2eb 100%);
    border-left: 4px solid #00A99D;
    padding: 15px 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    font-weight: 500;
}

.section {
    margin-bottom: 40px;
}

.section-header {
    background: linear-gradient(135deg, #0A2342 0%, #1e3a5f 100%);
    color: white;
    padding: 15px 25px;
    margin-bottom: 25px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(10, 35, 66, 0.2);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row.single {
    grid-template-columns: 1fr;
}

.form-group {
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #0A2342;
    font-size: 14px;
}

.required {
    color: #e74c3c;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #00A99D;
    box-shadow: 0 0 0 3px rgba(0, 169, 157, 0.1);
    transform: translateY(-1px);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* ==========================================================================
   Specific Components (Photo Box, Radios, Payment, Signature)
   ========================================================================== */
.form-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    gap: 30px;
}

.form-id {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px dashed #00A99D;
    font-weight: 500;
    color: #0A2342;
    flex: 1;
}

.photo-box {
    width: 120px;
    height: 150px;
    border: 2px dashed #00A99D;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.photo-box:hover {
    border-color: #0A2342;
    background: #e8f5f3;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 169, 157, 0.2);
}

.photo-placeholder {
    text-align: center;
    color: #00A99D;
    font-size: 12px;
    font-weight: 500;
}

.photo-placeholder i {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}

#photoPreview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 25px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.radio-item:hover {
    background: #f8f9fa;
    border-color: #00A99D;
}

.radio-item input[type="radio"] {
    width: auto;
    margin: 0;
    accent-color: #00A99D;
}

.radio-item.selected {
    background: linear-gradient(135deg, #00A99D 0%, #00d4aa 100%);
    color: white;
    border-color: #00A99D;
}

.program-info {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
    border-left: 4px solid #ffc107;
}

.program-info h4 {
    color: #0A2342;
    margin-bottom: 15px;
    font-size: 18px;
}

.program-info ul {
    list-style: none;
    padding-left: 0;
}

.program-info li {
    padding: 5px 0;
    position: relative;
    padding-left: 20px;
}

.program-info li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #00A99D;
    font-weight: bold;
}

.fee-structure {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    text-align: center;
    border: 2px solid #ffc107;
}

.fee-structure h4 {
    color: #0A2342;
    margin-bottom: 15px;
    font-size: 18px;
}

.total-fee {
    font-size: 28px;
    font-weight: 700;
    color: #0A2342;
    margin: 15px 0;
}

.fee-note {
    font-style: italic;
    color: #666;
    font-size: 14px;
}

.payment-options {
    display: grid;
    gap: 15px;
    margin-top: 20px;
}

.payment-option {
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.payment-option:hover {
    border-color: #00A99D;
    box-shadow: 0 4px 15px rgba(0, 169, 157, 0.1);
}

.payment-option.selected {
    border-color: #00A99D;
    background: linear-gradient(135deg, #e8f5f3 0%, #d1f2eb 100%);
}

.payment-option input[type="radio"] {
    position: absolute;
    top: 15px;
    right: 15px;
    accent-color: #00A99D;
}

.payment-option h5 {
    color: #0A2342;
    margin-bottom: 10px;
    font-size: 16px;
}

.referrer-field {
    margin-top: 15px;
    display: none;
}
.referrer-field label {
    margin-top: 15px;
}

.declaration-box {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    border: 2px solid #e1e8ed;
}

.declaration-text {
    line-height: 1.8;
    margin: 20px 0;
    color: #333;
}

.signature-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 25px;
}

.signature-field {
    text-align: center;
}

.signature-line {
    border-bottom: 2px solid #0A2342;
    margin-bottom: 8px;
    height: 40px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 5px;
    font-style: italic;
    font-family: 'Caveat', cursive;
    font-size: 18px;
    color: #1e3a5f;
    min-height: 25px; /* Ensure line is visible even if empty */
}

/* ==========================================================================
   Buttons & Footer
   ========================================================================== */
.submit-btn {
    background: linear-gradient(135deg, #00A99D 0%, #00d4aa 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 30px auto;
    box-shadow: 0 8px 20px rgba(0, 169, 157, 0.3);
    font-family: 'Montserrat', sans-serif;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(0, 169, 157, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.footer {
    background: #0A2342;
    color: white;
    text-align: center;
    padding: 20px;
    font-size: 14px;
}

/* ==========================================================================
   Thank You Page
   ========================================================================== */
.thank-you-page {
    display: none;
    text-align: center;
    padding: 60px 40px;
    background: linear-gradient(135deg, #e8f5f3 0%, #d1f2eb 100%);
}

.thank-you-page.show {
    display: block;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #00A99D 0%, #00d4aa 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    color: white;
    font-size: 36px;
    box-shadow: 0 8px 20px rgba(0, 169, 157, 0.3);
}

.thank-you-title {
    font-size: 32px;
    color: #0A2342;
    margin-bottom: 15px;
    font-weight: 700;
}

.thank-you-message {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

.email-confirmation {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin: 30px 0;
    border-left: 4px solid #00A99D;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.action-buttons {
    margin-top: 30px;
}

.download-btn {
    background: linear-gradient(135deg, #0A2342 0%, #1e3a5f 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
    box-shadow: 0 8px 20px rgba(10, 35, 66, 0.3);
    font-family: 'Montserrat', sans-serif;
}
.download-btn.print-btn {
     background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(10, 35, 66, 0.4);
}

.next-steps {
    margin-top: 40px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    border-left: 4px solid #00A99D;
}
.next-steps ul {
    text-align: left;
    margin-top: 15px;
    list-style-type: '✓ ';
    padding-left: 20px;
    line-height: 1.8;
}

/* ==========================================================================
   Utility & Helper Classes
   ========================================================================== */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(135deg, #00A99D 0%, #00d4aa 100%);
    transition: width 0.3s ease;
    z-index: 1000;
}

.form-group.error input,
.form-group.error textarea,
.form-group.error select {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.error-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.form-group.error .error-message {
    display: block;
}

/* ==========================================================================
   Declaration Label
   ========================================================================== */

label[for="declarationName"] {
  font-size: 16px;   /* adjust the text size */
  line-height: 1.5;
}

label[for="declarationName"] input {
  display: inline-block;   /* ensures it stays in the sentence */
  width: 200px;            /* control the length of the input */
  padding: 4px 6px;
  margin: 0 6px;           /* spacing between text and input */
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
}


/* ==========================================================================
   Media Queries for Responsiveness
   ========================================================================== */
@media (max-width: 768px) {
    body { padding: 10px; }
    .container { margin: 0; border-radius: 10px; }
    .form-container { padding: 20px; }
    .form-row { grid-template-columns: 1fr; gap: 15px; }
    .form-header { flex-direction: column; align-items: stretch; gap: 20px; }
    .photo-box { width: 100px; height: 120px; align-self: center; }
    .radio-group { flex-direction: column; gap: 10px; align-items: flex-start; }
    .signature-row { grid-template-columns: 1fr; gap: 20px; }
    .company-name { font-size: 24px; }
    .form-title h1 { font-size: 28px; }
}