/* Custom styles for IFPTR Certification Enrollment Portal */

:root {
    --primary-color: #002469;
    --primary-hover: #001d42;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #5261A9;
    --ifptr-blue: #5261A9;
    --ifptr-blue-hover: #414e87;
    --ifptr-dark: #212121;
    --ifptr-hover: #3F3F3F;
    --ifptr-light: #DADADA;
    --ifptr-text: #333333;
    /* Bootstrap CSS variable overrides */
    --bs-primary: #5261A9;
    --bs-primary-rgb: 82, 97, 169;
    --bs-info: #5261A9;
    --bs-info-rgb: 82, 97, 169;
}

/* Override Bootstrap primary color */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.text-primary {
    color: var(--ifptr-blue) !important;
}

.border-primary {
    border-color: var(--ifptr-blue) !important;
}

.text-info {
    color: var(--ifptr-blue) !important;
}

.border-info {
    border-color: var(--ifptr-blue) !important;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Hero Section */
.hero-section {
    background: #F0DEBA;  /* Warm beige/tan background matching asistar.ro */
    color: #002469;  /* Dark blue text for contrast */
    padding: 30px 0 0 0;  /* Reduced top padding */
    margin-bottom: 50px;
}

.hero-button-bar {
    background: #002469;  /* Dark blue full-width bar */
    padding: 25px 0;  /* Padding around button */
}

.hero-button-bar .btn-light {
    background-color: white;
    border-color: white;
    color: #002469;  /* Dark blue text */
    font-weight: 500;
}

.hero-button-bar .btn-light:hover {
    background-color: #f8f9fa;
    border-color: #f8f9fa;
    color: #002469;
}

.hero-section h1 {
    font-size: 1.25rem;  /* Slightly larger than body text */
    font-weight: 400;  /* Normal weight for regular text */
    margin-bottom: 1.5rem;
    color: #002469 !important;  /* Dark blue text */
    line-height: 1.8;  /* More spacing between lines */
}

/* Mobile optimization for hero text */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 1rem !important;  /* Match button text size */
        line-height: 1.3 !important;
        padding: 0 5px;  /* Minimal padding */
        word-spacing: -0.05em;  /* Tighter word spacing */
        letter-spacing: -0.01em;  /* Tighter letter spacing for compactness */
    }

    .hero-section {
        padding: 15px 0 0 0 !important;  /* Reduce top padding on mobile */
    }
}

/* Even smaller for very narrow screens */
@media (max-width: 400px) {
    .hero-section h1 {
        font-size: 0.95rem !important;  /* Slightly smaller for narrow phones */
        line-height: 1.25 !important;
        word-spacing: -0.08em;  /* Tighter spacing */
        letter-spacing: -0.02em;  /* Tighter letter spacing */
    }
}

/* Tablets and medium screens */
@media (min-width: 400px) and (max-width: 576px) {
    .hero-section h1 {
        font-size: 1rem !important;
        line-height: 1.3 !important;
        letter-spacing: -0.01em;
    }
}

.hero-section h1 strong {
    font-weight: 600;  /* Medium bold for emphasized text */
}

.hero-section h2,
.hero-section h3,
.hero-section h4,
.hero-section h5,
.hero-section h6 {
    color: #002469 !important;  /* Dark blue text */
}

.hero-section p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

/* How It Works Section - reduce font size for step descriptions */
section .text-muted {
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Course Cards */
.course-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.course-card .card-header {
    background: var(--primary-color);
    color: white !important;
    font-weight: 600;
    font-size: 1.25rem;
}

/* Ensure card headers with primary background have white text */
.card-header.bg-primary,
.card-header.bg-ifptr-primary {
    color: white !important;
}

.card-header.bg-primary h1,
.card-header.bg-primary h2,
.card-header.bg-primary h3,
.card-header.bg-primary h4,
.card-header.bg-primary h5,
.card-header.bg-primary h6,
.card-header.bg-ifptr-primary h1,
.card-header.bg-ifptr-primary h2,
.card-header.bg-ifptr-primary h3,
.card-header.bg-ifptr-primary h4,
.card-header.bg-ifptr-primary h5,
.card-header.bg-ifptr-primary h6 {
    color: white !important;
}

.price-badge {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success-color);
}

/* Buttons */
.btn-lg-custom {
    padding: 15px 40px;
    font-size: 1.1rem;
    border-radius: 50px;
}

/* Form Sections */
.form-section {
    background: #F0DEBA;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
}

.form-section h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

/* Progress Steps */
.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    position: relative;
    padding: 20px 0;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background: #dee2e6;
    z-index: 0;
    transform: translateY(-50%);
}

.step {
    position: relative;
    z-index: 1;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    border: 3px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: 10px;
    font-size: 1.25rem;
}

.step-label {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
}

.step.active .step-number {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.step.active .step-label {
    color: var(--primary-color);
    font-weight: 700;
}

.step.completed .step-number {
    background: var(--primary-color);
    border-color: #C78F3D;
    color: white;
}

.step.completed .step-label {
    color: #C78F3D;
}

.step.completed .step-label::before {
    content: "✓ ";
    font-weight: bold;
}

/* Course Selection Grid */
.course-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.course-option {
    position: relative;
}

.course-card-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    height: 100%;
    min-height: 220px;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.course-card-label:hover {
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

.btn-check:checked + .course-card-label {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.course-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.course-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.course-description {
    font-size: 0.875rem;
    margin-bottom: 15px;
}

.course-price {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Services List */
.services-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.service-option {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
}

.service-option:hover {
    background: #F0DEBA;
    border-color: var(--primary-color);
}

.service-option .form-check-input {
    margin-top: 0.5rem;
}

.service-option .form-check-input:checked {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.service-option label {
    width: 100%;
    cursor: pointer;
    margin-left: 10px;
}

/* Document Upload */
.document-item {
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 10px;
    transition: border-color 0.3s ease;
}

.document-item.uploaded {
    border-color: var(--success-color);
    background: #d1e7dd;
}

.document-item.required {
    border-color: var(--danger-color);
}

/* Exam Date Calendar */
.exam-date-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.exam-date-card:hover {
    background: #F0DEBA;
    border-color: var(--primary-color) !important;
}

.exam-date-card.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color) !important;
}

.capacity-badge {
    font-size: 0.875rem;
}

/* Admin Dashboard */
.dashboard-stat-card {
    border-left: 4px solid var(--primary-color);
}

.dashboard-stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Loading Indicator */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-request.htmx-indicator {
    display: inline-block;
}

/* Alerts */
.alert-dismissible {
    padding-right: 3rem;
}

/* Center Selection */
.center-card {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.center-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.center-card.selected {
    border-color: var(--success-color);
    background: #d1e7dd;
}

/* Footer Styling */
footer .footer-link {
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    padding: 0.25rem 0;
}

footer .footer-link:hover {
    color: var(--primary-color) !important;
    transform: translateX(5px);
}

.footer-payment-logo {
    filter: grayscale(10%);
    transition: filter 0.3s ease;
}

.footer-payment-logo:hover {
    filter: grayscale(0%);
}

/* Language selector - ensure white color on all screen sizes */
.navbar-lang-mobile .nav-link {
    color: white !important;
}

.navbar-lang-mobile .nav-link:hover,
.navbar-lang-mobile .nav-link:focus {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Responsive */
@media (max-width: 768px) {
    /* Hero h1 font-size now controlled by lines 86-113 */

    .hero-section p {
        font-size: 1rem;
    }

    .hero-section {
        padding: 50px 0;
    }

    /* Stats cards - reduce sizes and spacing on mobile */
    .bg-light.py-5 {
        padding: 1rem 0 !important;  /* Minimal section padding */
    }

    .bg-light .col-4 {
        margin-bottom: 0.5rem !important;  /* Reduce card margins */
    }

    .bg-light .card-body {
        padding: 0.3rem 0.25rem 0.12rem 0.25rem !important;  /* More top padding to visually balance text */
    }

    .bg-light .card-body i {
        font-size: 1.5rem !important;  /* Smaller icons */
        margin-bottom: 0.1rem !important;  /* Minimal space below icon */
        margin-top: 0 !important;
    }

    .bg-light .card-body h3 {
        font-size: 1rem !important;  /* Smaller numbers */
        margin-top: 0.1rem !important;  /* Minimal top spacing */
        margin-bottom: 0.1rem !important;  /* Minimal bottom spacing */
    }

    .bg-light .card-body p {
        font-size: 0.6rem !important;  /* Smaller text */
        line-height: 1.05 !important;  /* Very tight line height */
        margin-top: 0.1rem !important;
        margin-bottom: 0 !important;  /* No bottom margin */
        padding: 0 0.15rem !important;  /* No bottom padding, let card padding handle it */
    }

    /* Progress steps - fully horizontal, no scrolling */
    .progress-steps {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        gap: 3px !important;
        padding: 10px 0 !important;
        margin-bottom: 1.5rem !important;
    }

    .progress-steps::before {
        display: none !important; /* Hide connector line on mobile for cleaner look */
    }

    .step {
        flex: 1 !important;
        min-width: 0 !important; /* Allow flex items to shrink */
        flex-direction: column !important; /* Keep number above label */
        display: flex !important;
    }

    .step-label {
        font-size: 0.65rem !important;
        white-space: normal !important; /* Allow wrapping if needed */
        line-height: 1.2 !important;
        max-width: 100% !important;
        word-break: break-word !important;
    }

    .step-number {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.85rem !important;
        margin-bottom: 0.3rem !important;
    }

    /* Touch-friendly buttons */
    .btn {
        min-height: 48px;
        padding: 12px 20px;
        font-size: 1rem;
    }

    .btn-lg, .btn-lg-custom {
        min-height: 56px;
        padding: 16px 30px;
    }

    .btn-sm {
        min-height: 44px;
        padding: 10px 16px;
    }

    /* Form inputs - larger touch targets */
    .form-control,
    .form-select {
        min-height: 48px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    textarea.form-control {
        min-height: 120px;
    }

    /* Better checkbox/radio touch targets */
    .form-check-input {
        width: 24px;
        height: 24px;
        margin-top: 0.125rem;
    }

    .form-check-label {
        padding-left: 8px;
    }

    /* Service cards - stack on mobile */
    .services-list {
        gap: 20px;
    }

    .service-card {
        padding: 20px;
    }

    /* Better spacing for cards */
    .card {
        margin-bottom: 1.5rem;
    }

    /* Navbar improvements */
    .navbar .container {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
    }

    .navbar-brand {
        font-size: 1.25rem;
        flex-grow: 0;
        order: 1;
    }

    /* Split header text into 2 lines on mobile */
    .navbar-brand-text {
        display: inline-block;
        font-size: 0.85rem !important;
        line-height: 1.15;
        vertical-align: middle;
    }

    /* Language selector positioning on mobile */
    .navbar-lang-mobile {
        order: 2; /* Place after brand */
        margin-left: auto; /* Push to right */
    }

    .navbar-lang-mobile .nav-link {
        padding: 0.25rem 0.5rem;
        font-size: 0.9rem;
        color: white !important;
    }

    /* Footer - better mobile spacing */
    footer .col-lg-3,
    footer .col-lg-4 {
        margin-bottom: 2rem;
    }

    footer h5 {
        font-size: 1rem;
    }

    footer .small,
    footer ul li {
        font-size: 0.875rem;
    }

    .footer-payment-logo {
        max-width: 140px !important;
    }
}

@media (max-width: 576px) {
    /* Extra small screens */
    /* Hero h1 font-size now controlled by lines 86-113 */

    /* Progress steps - very compact on small phones */
    .step-number {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.75rem !important;
    }

    .step-label {
        font-size: 0.55rem !important;
        line-height: 1.1 !important;
    }

    /* Stack stat cards */
    .col-md-4 {
        margin-bottom: 1rem;
    }

    /* Smaller button fonts on very small screens */
    .btn-lg, .btn-lg-custom {
        font-size: 0.95rem;
        padding: 14px 24px;
    }
}

/* Override Bootstrap light background to match asistar.ro branding */
.bg-light {
    background-color: #F0DEBA !important;
}

/* Override primary buttons to use IFPTR light blue (#5261A9) */
.btn-primary {
    background-color: #5261A9 !important;
    border-color: #5261A9 !important;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: #414e87 !important;
    border-color: #414e87 !important;
}
.btn-primary:disabled {
    background-color: #8a94c4 !important;
    border-color: #8a94c4 !important;
}

/* Print Styles */
@media print {
    .navbar, footer, .btn, .no-print {
        display: none !important;
    }
}
