/* Font Face Declarations for Apotek */
@font-face {
    font-family: Apotek;
    src: url(/assets/fonnts.com-Apotek_Regular.otf) format("opentype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: Apotek;
    src: url(/assets/fonnts.com-Apotek_Medium.otf) format("opentype");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: Apotek;
    src: url(/assets/fonnts.com-Apotek_Semibold.otf) format("opentype");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: Apotek;
    src: url(/assets/fonnts.com-Apotek_Bold.otf) format("opentype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Global Resets */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Apotek, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #fff;
    color: #1a1a1a;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#root {
    min-height: 100vh;
}

/* App Layout */
.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #fff;
    font-family: Apotek, sans-serif;
}

/* Header */
.header {
    background-color: #fff;
    padding: 0;
    border-bottom: none;
}

.header-container {
    display: flex;
    align-items: center;
    padding: 16px 40px;
    width: 100%;
}

.header-logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.header-logo-img {
    height: 50px;
    width: auto;
    display: block;
    object-fit: contain;
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    padding: 40px 20px;
}

/* Billing Form */
.billing-form {
    display: flex;
    flex-direction: column;
    gap: 40px;
    font-family: Apotek, sans-serif;
}

.main-form-title {
    font-family: Apotek, sans-serif;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.form-section {
    margin-bottom: 30px;
}

.section-title {
    font-family: Apotek, sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 16px;
}

.section-subtitle {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
    font-family: Apotek, sans-serif;
}

.required {
    color: #e74c3c;
    margin-left: 4px;
}

/* Subsection */
.subsection {
    margin-top: 10px;
}

.subsection-title {
    font-size: 18px;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 15px;
    font-family: Apotek, sans-serif;
}

/* Form Inputs */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 8px;
    font-family: Apotek, sans-serif;
    color: #1a1a1a;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: Apotek, sans-serif;
    font-size: 15px;
    color: #1a1a1a;
    background-color: #fff;
    transition: all 0.2s ease;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: #9ca3af;
    font-family: Apotek, sans-serif;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 2px rgba(26, 26, 26, 0.05);
}

.form-input.error,
.form-textarea.error {
    border-color: #e74c3c;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Select Dropdown */
.form-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231a1a1a' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
    font-family: Apotek, sans-serif;
}

/* Name Fields (Side by Side) */
.name-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.name-field-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.name-sub-label {
    font-size: 11px;
    color: #6b7280;
    font-family: Apotek, sans-serif;
    font-weight: 400;
    margin-top: 2px;
}

/* Address Fields */
.address-fields {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 15px;
}

/* Product Cards */
.product-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.product-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 15px;
    color: #1a1a1a;
    line-height: 1.5;
    font-family: Apotek, sans-serif;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.product-card:hover {
    border-color: #1a1a1a;
    background-color: #f9fafb;
}

.product-card.selected {
    border-color: #1a1a1a;
    background-color: #f9fafb;
}

.product-checkbox-wrapper {
    display: flex;
    align-items: center;
    padding-top: 2px;
}

.product-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #27ae60;
    flex-shrink: 0;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-name {
    font-weight: 600;
    font-family: Apotek, sans-serif;
}

.product-details {
    display: flex;
    gap: 12px;
    color: #6b7280;
    font-size: 13px;
}

.product-date {
    color: #6b7280;
}

.product-price {
    color: #111827;
    font-weight: 600;
}

/* Cart Summary Inline */
.cart-summary-inline {
    margin-top: 16px;
    padding: 14px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    font-weight: 600;
    font-family: Apotek, sans-serif;
}

.cart-note {
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
    font-family: Apotek, sans-serif;
}

/* Radio & Checkbox Groups */
.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 8px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #1a1a1a;
    font-family: Apotek, sans-serif;
}

.radio-label input[type=radio] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4a90e2;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: #1a1a1a;
    line-height: 1.5;
    font-family: Apotek, sans-serif;
}

.checkbox-label input[type=checkbox] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #4a90e2;
    flex-shrink: 0;
}

/* Field Hint & Error */
.field-hint {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
    font-family: Apotek, sans-serif;
}

.error-message {
    font-size: 12px;
    color: #e74c3c;
    margin-top: 4px;
    font-family: Apotek, sans-serif;
}

/* Submit Button */
.submit-container {
    margin-top: 20px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.submit-button {
    width: 100%;
    padding: 14px 32px;
    background-color: #27ae60;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: Apotek, sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.submit-button:hover {
    background-color: #229954;
}

.submit-button:active {
    transform: scale(0.98);
}

.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Checkout Summary */
.checkout-summary {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    font-family: Apotek, sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #166534;
}

.checkout-amount {
    font-size: 20px;
    font-weight: 700;
    color: #15803d;
}

.checkout-breakdown {
    width: 100%;
    font-size: 13px;
    font-weight: 400;
    color: #4ade80;
    margin-top: 4px;
}

/* Footer */
.footer-container {
    background-color: #1a2332;
    color: #fff;
    padding: 60px 40px 30px;
    margin-top: 60px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto 40px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
}

.footer-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-logo {
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
    font-family: Apotek, sans-serif;
}

.community-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.community-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    font-family: Apotek, sans-serif;
}

.community-text {
    font-size: 14px;
    color: #b0b0b0;
    line-height: 1.6;
    font-family: Apotek, sans-serif;
}

.subscribe-form {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.subscribe-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #3a4a5a;
    border-radius: 6px;
    background-color: #2a3441;
    color: #fff;
    font-family: Apotek, sans-serif;
    font-size: 14px;
}

.subscribe-input::placeholder {
    color: #888;
}

.subscribe-input:focus {
    outline: none;
    border-color: #4a90e2;
}

.subscribe-button {
    padding: 12px 24px;
    background-color: #ff6b35;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: Apotek, sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.subscribe-button:hover {
    background-color: #e55a2b;
}

.footer-heading {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 10px;
    font-family: Apotek, sans-serif;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0;
}

.footer-links li {
    font-size: 14px;
    color: #b0b0b0;
    cursor: pointer;
    transition: color 0.3s ease;
    font-family: Apotek, sans-serif;
}

.footer-links li:hover {
    color: #fff;
}

.social-links-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 15px;
}

.contact-details {
    font-size: 14px;
    color: #b0b0b0;
    line-height: 1.6;
    font-family: Apotek, sans-serif;
}

.contact-details a {
    color: #4a90e2;
    text-decoration: none;
}

.contact-details a:hover {
    text-decoration: underline;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 30px;
    border-top: 1px solid #3a4a5a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    font-family: Apotek, sans-serif;
}

.footer-powered {
    font-size: 12px;
    color: #888;
    font-family: Apotek, sans-serif;
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        padding: 12px 20px;
        flex-wrap: wrap;
    }

    .header-logo-img {
        height: 40px;
    }

    .main-content {
        padding: 20px;
    }

    .name-fields,
    .address-fields {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

/* Student / Sibling Blocks */
.student-block {
    padding: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 20px;
    background: #fafafa;
}

.student-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.student-block-title {
    font-family: Apotek, sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.remove-sibling-btn {
    background: none;
    border: none;
    color: #e74c3c;
    font-family: Apotek, sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.remove-sibling-btn:hover {
    background-color: #fdecea;
}

.add-sibling-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: 2px dashed #27ae60;
    border-radius: 6px;
    background: transparent;
    color: #27ae60;
    font-family: Apotek, sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 5px;
}

.add-sibling-btn:hover {
    background-color: #f0fdf4;
    border-color: #229954;
    color: #229954;
}

/* PayPal Button Container */
.paypal-button-container {
    margin-top: 16px;
}

/* Payment Success */
.payment-success {
    text-align: center;
    padding: 60px 20px;
    max-width: 500px;
    margin: 0 auto;
}

.success-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.payment-success h2 {
    font-family: Apotek, sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #166534;
    margin-bottom: 12px;
}

.payment-success p {
    font-family: Apotek, sans-serif;
    font-size: 15px;
    color: #4a5568;
    margin-bottom: 20px;
}

.success-details {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 20px;
    margin: 24px 0;
}

.success-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-family: Apotek, sans-serif;
    font-size: 14px;
    color: #1a1a1a;
}

.success-detail-row + .success-detail-row {
    border-top: 1px solid #dcfce7;
}

.success-email-note {
    font-size: 13px;
    color: #6b7280;
    margin-top: 16px;
}

/* Payment Error */
.payment-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-family: Apotek, sans-serif;
    font-size: 14px;
    color: #991b1b;
}

/* Payment Processing */
.payment-processing {
    text-align: center;
    padding: 20px;
    font-family: Apotek, sans-serif;
    font-size: 15px;
    color: #4a5568;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Form Incomplete Hint */
.form-incomplete-hint {
    font-family: Apotek, sans-serif;
    font-size: 13px;
    color: #9ca3af;
    text-align: center;
    margin-top: 12px;
    font-style: italic;
}