﻿:root {
    --kco-blue: #003366;
    --kco-gold: #c5a017;
    --bg-light: #f8f9fa;
}

body {
    font-family: "Cairo", sans-serif;
    background-color: var(--bg-light);
    color: #333;
}

/* --- Header --- */
.kco-header {
    background: linear-gradient(-45deg, #001f3f, #003366, #1a4a7a, #001f3f);
    background-size: 400% 400%;
    animation: gradientBG 12s ease infinite;
    color: white;
    padding: 30px 0;
    border-bottom: 5px solid var(--kco-gold);
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.kco-logo-img {
    width: 180px;
    height: auto;
    margin-bottom: 15px;
    filter: drop-shadow(0px 0px 10px rgba(255, 255, 255, 0.2));
    transition: transform 0.3s ease;
}

    .kco-logo-img:hover {
        transform: scale(1.05);
    }

/* --- Form Structure --- */
.form-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    padding: 30px;
    border-top: 3px solid var(--kco-blue);
}

.section-title {
    color: var(--kco-blue);
    font-weight: 700;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
    margin-top: 25px;
}

/* --- Inputs --- */
.form-control,
.form-select,
.select2-container--bootstrap-5 .select2-selection {
    border-radius: 8px;
    padding: 10px 15px;
    border: 1px solid #ced4da;
}

    .form-control:focus,
    .form-select:focus {
        border-color: var(--kco-gold);
        box-shadow: 0 0 0 0.25rem rgba(197, 160, 23, 0.25);
    }

.input-group-text {
    background-color: #e9ecef;
    color: var(--kco-blue);
    font-weight: bold;
    border-radius: 8px;
}

/* --- Counters --- */
.char-counter {
    font-size: 0.75rem;
    color: #6c757d;
    display: block;
    text-align: left;
    margin-top: 4px;
    font-weight: 600;
}

    .char-counter.limit-reached {
        color: #dc3545;
    }

/* --- Companions Section Styling (ENHANCED) --- */
.companion-card {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-right: 4px solid var(--kco-gold); /* Right border accent for RTL */
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

    .companion-card:hover {
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        transform: translateY(-2px);
    }

.btn-add-companion {
    background-color: var(--kco-blue);
    color: white;
    border-radius: 50px;
    padding: 8px 25px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    border: none;
}

    .btn-add-companion:hover {
        background-color: var(--kco-gold);
        transform: translateY(-2px);
        color: #fff;
    }

.btn-delete {
    color: #dc3545;
    background: #fff;
    border: 1px solid #dc3545;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    cursor: pointer;
}

    .btn-delete:hover {
        background: #dc3545;
        color: white;
        transform: rotate(90deg);
    }

/* --- Declaration Box --- */
.declaration-box {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-top: 30px;
    font-size: 0.95rem;
    line-height: 1.8;
}

/* --- Submit Button --- */
.btn-submit {
    background-color: var(--kco-gold);
    color: #000;
    font-weight: bold;
    padding: 12px 40px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
}

    .btn-submit:hover {
        background-color: #b08d10;
        color: white;
    }

/* Fix for Select2 RTL */
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    text-align: right;
}

/* File input styling */
.form-text {
    font-size: 0.85rem;
    color: #6c757d;
}

/* Select2 dropdown customization */
.select2-container--bootstrap-5 .select2-dropdown {
    border-color: #ced4da;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: var(--kco-blue) !important;
    color: white !important;
}

.select2-container--bootstrap-5 .select2-results__option[aria-selected=true] {
    background-color: var(--kco-gold) !important;
    color: #000 !important;
}

/* IBAN input styling */
.iban-input.is-invalid {
    border-color: #dc3545;
    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: left calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.iban-input.is-valid {
    border-color: #198754;
    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: left calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.iban-hint {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 5px;
}

    .iban-hint.valid {
        color: #198754;
    }

    .iban-hint.invalid {
        color: #dc3545;
    }

.form-control,
.form-select {
    height: 48px;
}

/* Fix Select2 to match Bootstrap inputs */
.select2-container--bootstrap-5 .select2-selection--single {
    height: 48px !important;
    padding: 0.5rem 0.75rem !important;
    display: flex !important;
    align-items: center !important;
    border-radius: 8px !important;
}

    .select2-container--bootstrap-5
    .select2-selection--single
    .select2-selection__rendered {
        line-height: normal !important;
        padding: 0 !important;
        text-align: right;
    }

    .select2-container--bootstrap-5
    .select2-selection--single
    .select2-selection__arrow {
        height: 100% !important;
    }

/* Make rows more consistent vertically */
.row > [class*="col-"] {
    margin-bottom: 1rem;
}
