/**
 * Custom Styles
 * Treasurer Advanced Installment Payments Application
 * 
 * @version 1.0
 * @date 2025-11-13
 */

/* ========== Global Styles ========== */
:root {
    --primary-color: #2dc55f;/*#0d6efd;*/
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-bg: #f8f9fa;
    --border-color: #dee2e6;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: var(--light-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========== Header Styles ========== */
.app-header {
    background-color: #fff;
    border-bottom: 3px solid var(--primary-color);
    padding: 1.5rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.app-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

@media (max-width: 768px) {
    .app-title {
        font-size: 1.1rem;
    }
}

/* ========== Main Content ========== */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* ========== Footer Styles ========== */
.app-footer {
    background-color: #fff;
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    margin-top: 3rem;
    font-size: 0.875rem;
    color: var(--secondary-color);
}

/* ========== Form Tabs ========== */
.form-tabs-container {
    position: sticky;
    top: 0;
    z-index: 1020;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-tabs {
    background-color: #fff;
    border-bottom: 2px solid var(--border-color);
    padding: 0;
    margin-bottom: 0;
}

.form-tabs .nav-link {
    color: var(--secondary-color);
    font-weight: 500;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 1rem 1.5rem;
    transition: all 0.3s ease;
}

.form-tabs .nav-link:hover:not(.disabled) {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.form-tabs .nav-link.active {
    color: var(--primary-color);
    background-color: transparent;
    border-bottom-color: var(--primary-color);
}

.form-tabs .nav-link.disabled {
    color: var(--border-color);
    cursor: not-allowed;
}

/* ========== Form Styles ========== */
.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    border: 1.5px solid #ced4da;
    border-radius: 0.375rem;
    padding: 0.625rem 0.75rem;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* Form Validation Styles */
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--danger-color);
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-valid,
.form-select.is-valid {
    border-color: var(--success-color);
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.invalid-feedback {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--danger-color);
    font-weight: 500;
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15);
}

/* ========== Card Styles ========== */
.card {
    border: none;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.card-body {
    padding: 2rem;
}

/* ========== Button Styles ========== */
.btn {
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease-in-out;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #2dc55f; /* #0b5ed7; */
    border-color: #2dc55f;/* #0a58ca; */
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.2);
}

.btn-outline-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.2);
}

/* ========== Landing Page Styles ========== */
.landing-page {
    /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    background: linear-gradient(135deg, #e6f3eb 0%, #f5f9f6 100%);
}

.selection-card {
    transition: transform 0.3s ease;
}

.selection-card:hover .card {
    transform: translateY(-5px);
}

.hover-shadow {
    transition: box-shadow 0.3s ease;
}

.hover-shadow:hover {
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15) !important;
}

/* ========== CAPTCHA Page Styles ========== */
.captcha-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ========== Signature Canvas Styles ========== */
.signature-canvas-wrapper {
    border: 2px dashed var(--border-color);
    border-radius: 0.375rem;
    padding: 1rem;
    background-color: #fff;
    margin-bottom: 1rem;
    transition: border-color 0.3s ease;
}

.signature-canvas-wrapper:hover {
    border-color: var(--primary-color);
}

.signature-canvas-wrapper.active {
    border-color: var(--primary-color);
    border-style: solid;
}

#signatureCanvas {
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    cursor: crosshair;
    display: block;
    margin: 0 auto;
    background-color: #fff;
}

.signature-controls {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.signature-type-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.signature-type-option {
    flex: 1;
}

.signature-type-option input[type="radio"] {
    display: none;
}

.signature-type-label {
    display: block;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.375rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #fff;
}

.signature-type-option input[type="radio"]:checked + .signature-type-label {
    border-color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.05);
    color: var(--primary-color);
    font-weight: 600;
}

.signature-type-label:hover {
    border-color: var(--primary-color);
}

.signature-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 0.375rem;
    padding: 2rem;
    text-align: center;
    background-color: var(--light-bg);
    transition: all 0.3s ease;
}

.signature-upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.05);
}

.signature-file-info {
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: #d1ecf1;
    border-radius: 0.25rem;
    color: #0c5460;
}

/* ========== Alert Styles ========== */
.alert {
    border-radius: 0.375rem;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.alert-heading {
    font-weight: 600;
}

/* ========== Info Section Styles ========== */
.info-section h4,
.info-section h5 {
    color: var(--primary-color);
}

/* ========== Responsive Utilities ========== */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem 0;
    }

    .card-body {
        padding: 1.5rem;
    }

    .app-footer {
        text-align: center;
    }

    .app-footer .text-end {
        text-align: center !important;
        margin-top: 0.5rem;
    }

    .signature-type-selector {
        flex-direction: column;
    }

    #signatureCanvas {
        width: 100%;
        height: auto;
    }
}

/* ========== Print Styles ========== */
@media print {
    .app-header button,
    .app-footer,
    .btn,
    .form-tabs .nav-link:not(.active),
    .no-print {
        display: none !important;
    }

    .main-content {
        padding: 0;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid var(--border-color);
    }

    body {
        background-color: #fff;
    }
}

/* ========== Loading Spinner ========== */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* ========== Utility Classes ========== */
.text-primary {
    color: var(--primary-color) !important;
}

.text-muted {
    color: var(--secondary-color) !important;
}

.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.shadow {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}

/* ========== Custom Scrollbar ========== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a6268;
}

.method-card {
    border-radius: 1rem;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        background-color 0.15s ease;
    cursor: pointer;
}

.method-card:hover {
    background-color: #ffffff;
    box-shadow: 0 0.9rem 1.8rem rgba(15, 23, 42, 0.12);
    transform: translateY(-2px);
}

.method-icon {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #e5f0ff;
    font-size: 1.25rem;
}

/* ensure button clicks don't trigger card twice */
.method-card .btn {
    position: relative;
    z-index: 1;
}

