/* -------------------------------------------------------------
 * UTTAR PRADESH POLICE - OFFICIAL DARSHAN PASS PORTAL
 * MINIMALIST, HIGHLY FUNCTIONAL GOVERNMENT UI DESIGN
 * ------------------------------------------------------------- */
:root {
    --font-heading: 'Tiro Devanagari Hindi', 'Inter', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Clean Government Color Palette */
    --navy-header: #0f172a;
    --navy-dark: #1e293b;
    --bg-light-grey: #F4F7F6;
    --card-white: #ffffff;
    --primary-blue: #1d4ed8;
    --primary-blue-hover: #1e40af;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --border-grey: #cbd5e1;
    --border-light: #e2e8f0;
    
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    --shadow-subtle: 0 6px 25px rgba(15, 23, 42, 0.07);
}

/* Reset & Global Body */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.gov-minimal-theme {
    font-family: var(--font-body);
    background-color: var(--bg-light-grey);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* -------------------------------------------------------------
 * 1. HEADER (Navy Blue with Dual White Circular Logo Badges)
 * ------------------------------------------------------------- */
.gov-header {
    width: 100%;
    background-color: var(--navy-header);
    border-bottom: 3.5px solid var(--primary-blue);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 10;
}

.gov-header-container {
    max-width: 1250px;
    margin: 0 auto;
    padding: 1.1rem 1.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

/* Circular White Logo Badge */
.logo-circle-badge {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 2.5px solid var(--primary-blue);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.gov-police-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

/* Center Title Box */
.gov-header-title-box {
    text-align: center;
    flex-grow: 1;
}

.gov-header-title {
    font-family: 'Tiro Devanagari Hindi', serif;
    font-size: 2.3rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    line-height: 1.2;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

/* -------------------------------------------------------------
 * 2. MAIN CONTENT CONTAINER & CRISP WHITE CARD
 * ------------------------------------------------------------- */
.gov-main-container {
    width: 100%;
    max-width: 840px;
    margin: 2.5rem auto 3.5rem auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.gov-form-card {
    background: var(--card-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2.8rem 2.5rem;
    box-shadow: var(--shadow-subtle);
}

/* -------------------------------------------------------------
 * 3. FORM SECTIONS
 * ------------------------------------------------------------- */
#darshan-form {
    display: flex;
    flex-direction: column;
    gap: 2.2rem;
}

.gov-section {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.gov-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy-dark);
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.gov-section-title i {
    color: var(--primary-blue);
    font-size: 1rem;
}

.gov-section-body {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

/* -------------------------------------------------------------
 * 4. FORM FIELDS (Turns Blue on Focus)
 * ------------------------------------------------------------- */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.input-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.required {
    color: #dc2626;
}

.optional-tag {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input,
.input-wrapper select,
.input-wrapper textarea {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--border-grey);
    border-radius: var(--radius-sm);
    padding: 0.78rem 0.95rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

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

.input-wrapper input::placeholder,
.input-wrapper textarea::placeholder {
    color: #94a3b8;
}

/* Standard Focus State: Turns Blue on Focus */
.input-wrapper input:focus,
.input-wrapper select:focus,
.input-wrapper textarea:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3.5px rgba(29, 78, 216, 0.14);
}

/* Custom Select Arrow */
.select-wrapper {
    position: relative;
}

.select-wrapper select {
    appearance: none;
    cursor: pointer;
    padding-right: 2.2rem;
}

.select-arrow {
    position: absolute;
    right: 0.9rem;
    color: var(--text-secondary);
    pointer-events: none;
}

/* Devotee Count Boxes */
.count-box {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.count-label {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.count-box input {
    width: 100%;
    border: 1px solid var(--border-grey);
    border-radius: var(--radius-sm);
    padding: 0.78rem 0.95rem;
    font-size: 0.95rem;
    outline: none;
}

.count-box input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3.5px rgba(29, 78, 216, 0.14);
}

/* Validation Messages */
.error-msg {
    color: #dc2626;
    font-size: 0.82rem;
    font-weight: 600;
    display: none;
    margin-top: 0.2rem;
}

.input-group.invalid input,
.input-group.invalid select,
.input-group.invalid textarea {
    border-color: #dc2626;
    background-color: #fef2f2;
}

.input-group.invalid .error-msg {
    display: block;
}

/* -------------------------------------------------------------
 * 5. SUBMIT BUTTON: Solid Clean Blue Government Button
 * ------------------------------------------------------------- */
.gov-btn-primary {
    width: 100%;
    padding: 1.1rem;
    border: none;
    border-radius: var(--radius-sm);
    background-color: var(--primary-blue);
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: 0.8rem;
}

.gov-btn-primary:hover {
    background-color: var(--primary-blue-hover);
}

/* Config Banner */
.config-banner {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    color: #78350f;
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.hidden {
    display: none !important;
}

/* Success Modal Popup */
.modal-overlay.hidden {
    display: none !important;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.gov-modal {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.gov-success-icon {
    font-size: 3.2rem;
    color: #16a34a;
    margin-bottom: 0.8rem;
}

.gov-modal h2 {
    font-family: 'Tiro Devanagari Hindi', serif;
    font-size: 1.6rem;
    color: var(--navy-dark);
    margin-bottom: 0.4rem;
}

.gov-modal p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.4rem;
    line-height: 1.5;
}

.modal-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.gov-btn-secondary {
    width: 100%;
    padding: 0.85rem;
    border: 1.5px solid var(--primary-blue);
    border-radius: var(--radius-sm);
    background-color: #ffffff;
    color: var(--primary-blue);
    font-weight: 700;
    font-size: 0.98rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.gov-btn-secondary:hover {
    background-color: #eff6ff;
}

.gov-modal-btn {
    width: 100%;
    padding: 0.85rem;
    border: none;
    border-radius: var(--radius-sm);
    background-color: var(--primary-blue);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.98rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background-color 0.2s ease;
}

.gov-modal-btn:hover {
    background-color: var(--primary-blue-hover);
}

/* -------------------------------------------------------------
 * GOOGLE SUBMITTER IDENTITY CARD STYLES
 * ------------------------------------------------------------- */
.gov-account-card {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    margin-bottom: 1.8rem;
    overflow: hidden;
}

.account-card-header {
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.6rem 1rem;
}

.google-badge-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--navy-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.google-icon {
    color: #ea4335;
    font-size: 1.05rem;
}

.account-card-body {
    padding: 1rem 1.2rem;
}

.signed-in-box {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
}

.user-avatar-badge {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #16a34a;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.user-info-text {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.user-name-str {
    font-weight: 700;
    font-size: 0.98rem;
    color: #0f172a;
}

.user-email-str {
    font-size: 0.86rem;
    color: #475569;
}

.change-account-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 0.45rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.change-account-btn:hover {
    background: #eff6ff;
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.login-prompt-box {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.login-desc {
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.4;
}

.account-save-btn {
    margin-top: 0.4rem;
}

/* -------------------------------------------------------------
 * MANDATORY GOOGLE SIGN-IN LOCK OVERLAY
 * ------------------------------------------------------------- */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.2rem;
}

.auth-modal-overlay.hidden {
    display: none !important;
}

.auth-modal-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 2.2rem 2rem;
    max-width: 460px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    border: 2px solid var(--primary-blue);
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.auth-header-badge {
    width: 70px;
    height: 70px;
    margin: 0 auto 1rem auto;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid var(--primary-blue);
    padding: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.auth-police-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.auth-title {
    font-family: 'Tiro Devanagari Hindi', serif;
    font-size: 1.55rem;
    color: var(--navy-dark);
    margin-bottom: 0.3rem;
}

.auth-subtitle {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 0.8rem;
}

.auth-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-bottom: 1.4rem;
}

.google-auth-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.auth-divider {
    width: 100%;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    line-height: 0.1em;
    margin: 1.2rem 0 1rem 0;
}

.auth-divider span {
    background: #ffffff;
    padding: 0 10px;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 600;
}

.google-manual-entry {
    width: 100%;
}

/* Voice Typing & Select Search Styles */
.sub-label-note {
    font-weight: 500;
    color: #dc2626;
    font-size: 0.84rem;
}

.mic-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.mic-wrapper input,
.mic-wrapper textarea {
    padding-right: 2.8rem !important;
}

.voice-mic-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: var(--primary-blue);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.92rem;
    transition: all 0.2s ease;
    z-index: 5;
}

.voice-mic-btn.textarea-mic-btn {
    top: 1.2rem;
    transform: none;
}

.voice-mic-btn:hover {
    background: var(--primary-blue);
    color: #ffffff;
    border-color: var(--primary-blue);
}

.voice-mic-btn.listening {
    background: #fef2f2;
    border-color: #ef4444;
    color: #ef4444;
    animation: pulseMic 1.2s infinite;
}

@keyframes pulseMic {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Searchable Select Popup Modal */
.search-modal-content {
    max-width: 480px;
    padding: 1.5rem 1.2rem;
    text-align: left;
}

.search-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1.5px solid var(--border-light);
}

.search-modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy-dark);
}

.close-search-btn {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

.close-search-btn:hover {
    color: #ef4444;
}

.search-modal-input-wrapper {
    position: relative;
    margin-bottom: 0.9rem;
}

.search-modal-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.95rem;
}

#search-modal-input {
    width: 100%;
    padding: 0.75rem 0.9rem 0.75rem 2.4rem;
    border: 1.5px solid var(--primary-blue);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    outline: none;
    background: #f8fafc;
}

#search-modal-input:focus {
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.search-modal-options-list {
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.search-option-item {
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid #f1f5f9;
}

.search-option-item:hover,
.search-option-item.selected {
    background: #eff6ff;
    color: var(--primary-blue);
    font-weight: 600;
}

/* Custom Searchable Dropdown Styling */
.custom-select-container {
    position: relative;
    width: 100%;
}

.custom-select-container.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    background-color: #ffffff;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.custom-select-trigger:hover,
.custom-select-trigger.active {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.trigger-arrow {
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: transform 0.2s ease;
}

.custom-select-trigger.active .trigger-arrow {
    transform: rotate(180deg);
    color: var(--primary-blue);
}

.custom-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 100;
    background: #ffffff;
    border: 1.5px solid var(--primary-blue);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: fadeInDown 0.15s ease;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.custom-search-wrapper {
    position: relative;
    padding: 0.6rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.custom-search-wrapper .search-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.88rem;
}

.custom-search-input {
    width: 100%;
    padding: 0.55rem 0.8rem 0.55rem 2.2rem;
    font-size: 0.9rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    outline: none;
    background: #ffffff;
}

.custom-search-input:focus {
    border-color: var(--primary-blue);
}

.custom-options-list {
    max-height: 220px;
    overflow-y: auto;
}

.custom-option-item {
    padding: 0.65rem 1rem;
    font-size: 0.92rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid #f1f5f9;
}

.custom-option-item:last-child {
    border-bottom: none;
}

.custom-option-item:hover,
.custom-option-item.selected {
    background: #eff6ff;
    color: var(--primary-blue);
    font-weight: 600;
}

.custom-option-empty {
    padding: 0.8rem 1rem;
    font-size: 0.88rem;
    color: #94a3b8;
    text-align: center;
}

/* -------------------------------------------------------------
 * 6. FOOTER
 * ------------------------------------------------------------- */
.gov-footer {
    width: 100%;
    background-color: var(--navy-header);
    padding: 1.4rem 1rem;
    text-align: center;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    border-top: 1px solid #1e293b;
}

.footer-line-1 {
    color: #e2e8f0;
    font-size: 0.9rem;
    font-weight: 500;
}

.footer-line-2 {
    color: #38bdf8;
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Responsive Mobile Optimization */
@media (max-width: 768px) {
    .gov-header-container {
        padding: 0.8rem 1rem;
        gap: 0.6rem;
    }

    .logo-circle-badge {
        width: 52px;
        height: 52px;
        padding: 2.5px;
    }
    
    .gov-header-title {
        font-size: 1.35rem;
    }

    .gov-main-container {
        margin: 1.2rem auto 2.5rem auto;
        padding: 0 0.6rem;
    }

    .grid-2 {
        grid-template-columns: 1fr;
        gap: 0.9rem;
    }

    .gov-form-card {
        padding: 1.5rem 1rem;
    }

    .auth-modal-card {
        padding: 1.6rem 1.2rem;
        max-width: 95%;
    }

    .auth-title {
        font-size: 1.3rem;
    }

    .auth-subtitle {
        font-size: 0.95rem;
    }

    .auth-desc {
        font-size: 0.84rem;
        margin-bottom: 1.1rem;
    }

    .signed-in-box {
        padding: 0.6rem 0.8rem;
    }

    .user-name-str {
        font-size: 0.9rem;
    }

    .user-email-str {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .logo-circle-badge {
        width: 44px;
        height: 44px;
    }

    .gov-header-title {
        font-size: 1.15rem;
    }

    .gov-form-card {
        padding: 1.2rem 0.85rem;
        border-radius: var(--radius-md);
    }

    .gov-btn-primary {
        padding: 0.95rem;
        font-size: 1rem;
    }
}
