/* ============================================
   JAMIA IMAM MEHDI - MEMBERSHIP FORM STYLES
   Islamic-themed Premium Form Design
   ============================================ */

:root {
    --emerald-900: #064e24;
    --emerald-800: #0a6b33;
    --emerald-700: #0f7b3c;
    --emerald-600: #148c46;
    --emerald-500: #1a9e52;
    --emerald-50: #ecfdf3;
    --gold-500: #c9a53a;
    --gold-400: #d4b44e;
    --gold-300: #e6cc7a;
    --gold-200: #f0dfa0;
    --gold-100: #faf3d8;
    --bg-body: #e8ede8;
    --bg-white: #ffffff;
    --bg-cream: #fdfcf8;
    --text-primary: #1a2e1a;
    --text-secondary: #4a5a4a;
    --text-muted: #7a8a7a;
    --border-color: #c4cec4;
    --border-light: #dce4dc;
    --positive: #16a34a;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-card: 0 8px 40px rgba(6, 78, 36, 0.12);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { 
    font-size: 14px; 
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background:
        url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L60 15L60 45L30 60L0 45L0 15Z' fill='none' stroke='rgba(6,78,36,0.04)' stroke-width='0.5'/%3E%3Ccircle cx='30' cy='30' r='8' fill='none' stroke='rgba(6,78,36,0.025)' stroke-width='0.4'/%3E%3C/svg%3E"),
        linear-gradient(135deg, #e0e8e0 0%, #d8e2d8 50%, #e4ebe4 100%);
    color: var(--text-primary);
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -webkit-overflow-scrolling: touch;
}

a { text-decoration: none; color: inherit; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }

/* ============================================
   PAGE LAYOUT
   ============================================ */
.form-page {
    max-width: 850px;
    margin: 0 auto;
    padding: 30px 20px 60px;
    position: relative;
}

/* Back Button */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--emerald-800);
    color: #ffffff;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
    transition: all var(--transition-normal);
    box-shadow: 0 2px 8px rgba(6, 78, 36, 0.2);
}

.back-btn:hover {
    background: var(--emerald-900);
    transform: translateX(-3px);
    box-shadow: 0 4px 12px rgba(6, 78, 36, 0.3);
}

/* Print Button */
.print-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--emerald-700), var(--emerald-800));
    color: #ffffff;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(6, 78, 36, 0.3);
    transition: all var(--transition-normal);
}

.print-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(6, 78, 36, 0.4);
    background: linear-gradient(135deg, var(--emerald-800), var(--emerald-900));
}

/* ============================================
   FORM CARD
   ============================================ */
.form-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    position: relative;
    padding: 12px;
    border: 1px solid var(--border-light);
}

/* Islamic Corner Decorations */
.corner-decoration {
    position: absolute;
    width: 50px;
    height: 50px;
    z-index: 2;
}

.corner-decoration::before,
.corner-decoration::after {
    content: '';
    position: absolute;
}

.corner-decoration.top-left {
    top: 0; left: 0;
    border-top: 3px solid var(--emerald-700);
    border-left: 3px solid var(--emerald-700);
    border-radius: var(--radius-lg) 0 0 0;
}

.corner-decoration.top-right {
    top: 0; right: 0;
    border-top: 3px solid var(--emerald-700);
    border-right: 3px solid var(--emerald-700);
    border-radius: 0 var(--radius-lg) 0 0;
}

.corner-decoration.bottom-left {
    bottom: 0; left: 0;
    border-bottom: 3px solid var(--emerald-700);
    border-left: 3px solid var(--emerald-700);
    border-radius: 0 0 0 var(--radius-lg);
}

.corner-decoration.bottom-right {
    bottom: 0; right: 0;
    border-bottom: 3px solid var(--emerald-700);
    border-right: 3px solid var(--emerald-700);
    border-radius: 0 0 var(--radius-lg) 0;
}

/* Inner Border */
.form-inner-border {
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0;
    overflow: hidden;
    position: relative;
}

/* ============================================
   FORM HEADER
   ============================================ */
.form-header {
    text-align: center;
    padding: 28px 24px 20px;
    position: relative;
    border-bottom: 2px solid var(--emerald-700);
    background: linear-gradient(to bottom, rgba(6, 78, 36, 0.02), transparent);
}

.header-mosque-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.mosque-svg {
    width: 100%;
    height: 100%;
}

/* Logo */
.header-logo {
    width: 70px;
    height: 70px;
    margin: 0 auto 8px;
    border-radius: 50%;
    overflow: hidden;
    background: radial-gradient(circle at 30% 30%, rgba(201, 165, 58, 0.15), rgba(255, 255, 255, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(201, 165, 58, 0.4);
    box-shadow: 0 0 15px rgba(201, 165, 58, 0.1);
    position: relative;
    z-index: 1;
}

.form-logo-img {
    width: 52px;
    height: auto;
    object-fit: contain;
}

.header-org-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--emerald-800);
    position: relative;
    z-index: 1;
}

.header-org-subtitle {
    font-size: 0.72rem;
    color: var(--gold-500);
    font-style: italic;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.form-title {
    position: relative;
    z-index: 1;
    margin-bottom: 12px;
}

.title-line1 {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--emerald-900);
    line-height: 1.2;
}

.title-line2 {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--emerald-800);
    line-height: 1.2;
}

/* Membership Badge */
.membership-badge {
    display: inline-flex;
    position: relative;
    z-index: 1;
    margin-bottom: 16px;
}

.membership-badge span {
    padding: 8px 32px;
    background: linear-gradient(135deg, var(--emerald-700), var(--emerald-800));
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    border-radius: 4px;
    position: relative;
    box-shadow: 0 3px 12px rgba(6, 78, 36, 0.2);
}

.membership-badge span::before,
.membership-badge span::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
}

.membership-badge span::before {
    left: -8px;
    border-right: 8px solid var(--emerald-700);
    border-top: 18px solid transparent;
    border-bottom: 18px solid transparent;
}

.membership-badge span::after {
    right: -8px;
    border-left: 8px solid var(--emerald-800);
    border-top: 18px solid transparent;
    border-bottom: 18px solid transparent;
}

/* Contact Bar */
.contact-bar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--emerald-900), var(--emerald-800));
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(6, 78, 36, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(201, 165, 58, 0.4);
    margin: 0 auto;
    overflow: hidden;
}

.contact-bar::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    animation: shine 6s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    20% { left: 200%; }
    100% { left: 200%; }
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #ffffff;
    padding: 4px 16px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.contact-item:not(:last-child) {
    border-right: 1px solid rgba(201, 165, 58, 0.3);
}

.contact-item i {
    color: var(--gold-400);
    font-size: 0.95rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* ============================================
   FORM BODY
   ============================================ */
.membership-form {
    padding: 24px 28px 16px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 14px;
}

.form-row.two-col .form-group {
    flex: 1;
}

.form-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-group.full {
    flex: 1;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    min-width: fit-content;
    flex-shrink: 0;
}

.form-label i {
    color: var(--emerald-700);
    font-size: 0.8rem;
    width: 16px;
    text-align: center;
}

.label-colon {
    color: var(--text-muted);
    font-weight: 600;
    flex-shrink: 0;
    margin: 0 2px;
}

.form-input {
    flex: 1;
    padding: 9px 0 8px;
    border: none;
    border-bottom: 1.5px solid var(--border-color);
    font-family: inherit;
    font-size: 0.88rem;
    color: var(--text-primary);
    background: transparent;
    transition: all var(--transition-normal);
    outline: none;
    min-width: 0;
}

.form-input::placeholder {
    color: #bbb;
    font-size: 0.8rem;
}

.form-input:focus {
    border-bottom-color: var(--emerald-700);
    box-shadow: 0 2px 0 0 rgba(6, 78, 36, 0.1);
}

.form-input:hover {
    border-bottom-color: var(--emerald-600);
}

/* Date inputs */
input[type="date"].form-input {
    cursor: pointer;
}

input[type="date"].form-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.5;
    transition: opacity var(--transition-fast);
}

input[type="date"].form-input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Form Divider */
.form-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--emerald-700), var(--gold-500), var(--emerald-700), transparent);
    margin: 18px 0;
    opacity: 0.25;
}

/* ============================================
   MARHOOM SECTION
   ============================================ */
.marhoom-block {
    background: rgba(6, 78, 36, 0.02);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 16px;
    position: relative;
}

.marhoom-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border-color);
}

.marhoom-header h4 {
    font-size: 0.85rem;
    color: var(--emerald-800);
}

.remove-marhoom-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--negative);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background var(--transition-fast);
}

.remove-marhoom-btn:hover {
    background: rgba(220, 38, 38, 0.1);
}

.add-more-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.add-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--emerald-700);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px dashed var(--emerald-700);
    transition: all var(--transition-fast);
}

.add-more-btn:hover {
    background: var(--emerald-50);
    color: var(--emerald-800);
    border-style: solid;
}

/* ============================================
   SIGNATURE SECTION
   ============================================ */
.signature-section {
    display: flex;
    justify-content: flex-end;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px dashed var(--border-color);
}

.signature-box {
    flex: 1;
    text-align: center;
}

.signature-line {
    width: 100%;
    height: 1px;
    background: var(--text-primary);
    margin-bottom: 8px;
    margin-top: 50px;
}

.signature-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ============================================
   FORM ACTIONS (Digital)
   ============================================ */
.form-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: all var(--transition-normal);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--emerald-700), var(--emerald-800));
    color: #ffffff;
    box-shadow: 0 3px 12px rgba(6, 78, 36, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--emerald-800), var(--emerald-900));
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(6, 78, 36, 0.35);
}

.btn-secondary {
    background: var(--bg-cream);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #f0f0f0;
    color: var(--text-primary);
}

/* Razorpay Pay Online Button */
.btn-pay {
    background: linear-gradient(135deg, #1a1a2e, #16213e) !important;
    color: #ffffff !important;
    border: 1px solid rgba(80, 80, 200, 0.3) !important;
    box-shadow: 0 3px 12px rgba(22, 33, 62, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-pay::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.btn-pay:hover::before {
    left: 150%;
}

.btn-pay:hover {
    background: linear-gradient(135deg, #0f0f1f, #0d1530) !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(22, 33, 62, 0.45);
}

.btn-pay i {
    color: #7c9fff;
}

/* ============================================
   FOOTER MOSQUE
   ============================================ */
.form-footer-mosque {
    padding: 0 20px;
    margin-top: -4px;
}

.form-footer-mosque svg {
    width: 100%;
    height: 50px;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-card {
    animation: fadeInUp 0.6s ease forwards;
}

.form-row {
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
}

.form-row:nth-child(1) { animation-delay: 0.1s; }
.form-row:nth-child(2) { animation-delay: 0.14s; }
.form-row:nth-child(3) { animation-delay: 0.18s; }
.form-row:nth-child(4) { animation-delay: 0.22s; }
.form-row:nth-child(5) { animation-delay: 0.26s; }
.form-row:nth-child(6) { animation-delay: 0.30s; }
.form-row:nth-child(7) { animation-delay: 0.34s; }
.form-row:nth-child(8) { animation-delay: 0.38s; }
.form-row:nth-child(9) { animation-delay: 0.42s; }
.form-row:nth-child(10) { animation-delay: 0.46s; }
.form-row:nth-child(11) { animation-delay: 0.50s; }
.form-row:nth-child(12) { animation-delay: 0.54s; }
.form-row:nth-child(13) { animation-delay: 0.58s; }
.form-row:nth-child(14) { animation-delay: 0.62s; }

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    body {
        background: white !important;
    }

    .form-page {
        padding: 0;
        max-width: 100%;
    }

    .back-btn,
    .print-btn,
    .form-actions,
    .btn,
    .remove-marhoom-btn,
    .add-more-container {
        display: none !important;
    }

    .form-card {
        box-shadow: none;
        border: none;
        padding: 0;
        animation: none;
    }

    .form-inner-border {
        border-color: #aaa;
    }

    .form-row {
        animation: none;
        opacity: 1;
    }

    .form-input {
        border-bottom: 1px dotted #666;
    }
    
    .marhoom-block {
        background: transparent;
        border: none;
        padding: 0;
        margin-bottom: 20px;
    }
    
    .marhoom-header {
        border-bottom-color: #aaa;
    }

    .corner-decoration {
        border-color: #333 !important;
    }

    .form-header {
        border-bottom-color: #333;
    }

    .membership-badge span {
        background: #333;
        box-shadow: none;
    }

    .membership-badge span::before {
        border-right-color: #333;
    }

    .membership-badge span::after {
        border-left-color: #333;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 700px) {
    .form-page {
        padding: 16px 10px 80px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .form-card {
        padding: 8px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    .form-inner-border {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .membership-form {
        padding: 16px 10px;
        width: 100%;
        box-sizing: border-box;
    }

    .form-row {
        flex-direction: column;
        gap: 12px;
    }

    .form-row.two-col .form-group {
        flex: unset;
    }

    .form-group {
        flex-wrap: wrap;
    }

    .form-input {
        width: 100%;
        flex: unset;
        box-sizing: border-box;
    }

    .form-header {
        padding: 20px 10px 16px;
        width: 100%;
        box-sizing: border-box;
    }

    .title-line1 { font-size: 1.3rem; word-wrap: break-word; }
    .title-line2 { font-size: 1.1rem; word-wrap: break-word; }

    .contact-bar {
        flex-direction: column;
        gap: 8px;
        border-radius: var(--radius-md);
        padding: 12px 8px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .contact-item {
        font-size: 0.75rem;
        line-height: 1.5;
        word-break: break-word;
        max-width: 100%;
        text-align: center;
        justify-content: center;
        flex-wrap: wrap;
        padding: 4px;
    }

    .contact-item:not(:last-child) {
        border-right: none;
        border-bottom: 1px dashed rgba(201, 165, 58, 0.3);
        padding-bottom: 8px;
        width: 100%;
    }

    .signature-section {
        gap: 20px;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        justify-content: center;
    }

    .print-btn {
        bottom: 16px;
        right: 16px;
        padding: 12px 20px;
        font-size: 0.82rem;
    }
}

/* Scrollbar */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: #e8ede8; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--emerald-700), var(--gold-500));
    border-radius: 4px;
}

/* ============================================
   SUCCESS OVERLAY
   ============================================ */
.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    backdrop-filter: blur(8px);
}

.success-overlay.active {
    opacity: 1;
    visibility: visible;
}

.success-content {
    text-align: center;
    padding: 40px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 50px rgba(6, 78, 36, 0.2);
    border: 2px solid var(--emerald-700);
    max-width: 400px;
    width: 90%;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-overlay.active .success-content {
    transform: translateY(0) scale(1);
}

.success-content lottie-player {
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(6, 78, 36, 0.1);
}

.success-content h2 {
    color: var(--emerald-800);
    margin-bottom: 10px;
    font-size: 1.5rem;
    font-family: 'Playfair Display', serif;
}

.success-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}
