/* Základní styly pro sekce */
.form-section {
    transition: all 0.3s ease;
}

.form-section.hidden {
    display: none;
}

.form-section.active {
    display: block;
}

/* Styling pro Register tlačítko */
.btn-register {
    width: 100%;
    padding: 12px;
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    font-size: var(--font-base);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-register:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

/* Karty grid */
.cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.user-type-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 25px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.user-type-card:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color-15), var(--secondary-color-15));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.user-type-card:hover:before {
    opacity: 1;
}

.user-type-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.card-icon {
    font-size: var(--font-3xl);
    color: var(--primary-color);
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.card-title {
    font-size: var(--font-lg);
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.card-description {
    font-size: var(--font-sm);
    color: #7f8c8d;
    line-height: 1.4;
    position: relative;
    z-index: 1;
}

/* Back tlačítko */
.btn-back {
    background: transparent;
    color: #7f8c8d;
    border: none;
    font-size: var(--font-sm);
    cursor: pointer;
    padding: 8px 0;
    transition: color 0.3s ease;
}

.btn-back:hover {
    color: var(--primary-color);
}

.back-link-section {
    text-align: center;
}

.register-link-section {
    margin-top: 20px;
}

/* Ostatní styly */
.help-block {
    color: #e74c3c;
    font-size: var(--font-sm);
    margin-top: 5px;
}

.form-group.focused .form-control {
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.checkbox-wrapper input[type="checkbox"] {
    margin-right: 8px;
}

/* Registration Layout Styles - OPATRNĚ OPRAVENO SCROLLOVÁNÍ */
.registration-layout {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: white;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.registration-layout.show {
    opacity: 1;
    visibility: visible;
}

.registration-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 20px 40px;
    min-height: 120px;
    display: flex;
    align-items: center;
    position: relative;
    flex-shrink: 0;
}

.registration-header-content {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.back-to-cards-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: var(--font-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-to-cards-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateX(-2px);
}

.registration-title-section {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.registration-icon {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-xl);
}

.registration-title-text h2 {
    margin: 0 0 5px 0;
    font-size: var(--font-xl);
    font-weight: 600;
}

.registration-title-text p {
    margin: 0;
    font-size: var(--font-sm);
    opacity: 0.9;
}

.registration-progress {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.progress-bar {
    width: 120px;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0;
}

.progress-fill {
    width: 33%;
    height: 100%;
    background: white;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: var(--font-xs);
    opacity: 0.8;
}

/* OPRAVENÝ CONTAINER PRO SCROLLOVÁNÍ */
.registration-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background: white;
    padding: 0;
    position: relative;
}

.registration-form-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px;
    box-sizing: border-box;
}

.registration-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0; /* Odstraníme gap z hlavního gridu */
}

/* ŠIRŠÍ LAYOUT - VÍCE POLÍ NA ŘÁDEK */
#registration-form-content {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* 6 sloupců pro flexibilní layout */
    gap: 20px 25px;
    align-items: start;
    margin-bottom: 40px;
}

.registration-form .form-group {
    margin-bottom: 0;
    grid-column: span 2; /* Defaultně zabere 2 sloupce */
}

.registration-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
    font-size: var(--font-sm);
}

.registration-form .form-control {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: var(--font-base);
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: white;
}

.registration-form .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-color-10);
    transform: translateY(-1px);
}

/* KONKRÉTNÍ ŠÍŘKY POLÍ PRO ŠIRŠÍ LAYOUT */

/* Jméno a Příjmení - normální šířka */
.registration-form .form-group:has(#reg_first_name),
.registration-form .form-group:has(#reg_last_name) {
    grid-column: span 2;
}

/* Titul - úzký */
.registration-form .form-group:has(#reg_title) {
    grid-column: span 1;
}

/* Telefon a Email - normální */
.registration-form .form-group:has(#reg_phone),
.registration-form .form-group:has(#reg_email) {
    grid-column: span 2;
}

/* Datum narození a číslo OP - menší */
.registration-form .form-group:has(#reg_birth_date),
.registration-form .form-group:has(#reg_id_number) {
    grid-column: span 2;
}

/* IČ - menší */
.registration-form .form-group:has(#reg_ico) {
    grid-column: span 1;
}

/* Širší pole pro dlouhé texty */
.registration-form .form-group:has(#reg_business_name),
.registration-form .form-group:has(#reg_representative) {
    grid-column: span 6;
}

/* Adresní pole */
.registration-form .form-group:has(#reg_city),
.registration-form .form-group:has(#reg_permanent_city),
.registration-form .form-group:has(#reg_property_city) {
    grid-column: span 2;
}

.registration-form .form-group:has(#reg_postal_code),
.registration-form .form-group:has(#reg_permanent_postal_code),
.registration-form .form-group:has(#reg_property_postal_code) {
    grid-column: span 1;
}

.registration-form .form-group:has(#reg_street),
.registration-form .form-group:has(#reg_permanent_street),
.registration-form .form-group:has(#reg_property_street) {
    grid-column: span 2;
}

.registration-form .form-group:has(#reg_house_number),
.registration-form .form-group:has(#reg_orientation_number),
.registration-form .form-group:has(#reg_permanent_house_number),
.registration-form .form-group:has(#reg_permanent_orientation_number),
.registration-form .form-group:has(#reg_property_house_number),
.registration-form .form-group:has(#reg_property_orientation_number) {
    grid-column: span 1;
}

/* Vlastnické údaje */
.registration-form .form-group:has(#reg_ownership_certificate),
.registration-form .form-group:has(#reg_cadastral_area) {
    grid-column: span 3;
}

/* Parkovací zóna */
.registration-form .form-group:has(#reg_parking_zone) {
    grid-column: span 3;
}

/* STYLY PRO SEKCE FORMULÁŘŮ */
.form-section-header {
    grid-column: 1 / -1;
    margin: 40px 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f3f4;
}

.form-section-header h3 {
    margin: 0 0 8px 0;
    font-size: var(--font-lg);
    font-weight: 600;
    color: var(--text-color);
}

.form-section-header p {
    margin: 0;
    font-size: var(--font-sm);
    color: #6c757d;
    line-height: 1.4;
}

/* TLAČÍTKA - VIDITELNÁ A PŘÍSTUPNÁ */
.registration-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 20px;
    padding: 30px 0 20px 0;
    border-top: 2px solid #f8f9fa;
    margin-top: 20px;
}

.btn-secondary {
    padding: 12px 25px;
    background: transparent;
    color: #6c757d;
    border: 2px solid #6c757d;
    border-radius: 8px;
    font-size: var(--font-base);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #6c757d;
    color: white;
}

.btn-primary {
    padding: 12px 25px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: var(--font-base);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.3);
}

/* Checkbox styling */
.registration-form input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.1);
    cursor: pointer;
}

.registration-form .checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    grid-column: 1 / -1;
    margin: 20px 0;
}

.registration-form .checkbox-wrapper label {
    margin-bottom: 0;
    cursor: pointer;
    line-height: 1.4;
}

/* Placeholder styling */
.registration-form .form-control::placeholder {
    color: #adb5bd;
    font-style: italic;
}

/* Select styling */
.registration-form select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 12px;
    padding-right: 40px;
}

/* Responsivní design */
@media (max-width: 1400px) {
    #registration-form-content {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .registration-form .form-group:has(#reg_business_name),
    .registration-form .form-group:has(#reg_representative) {
        grid-column: span 4;
    }
    
    .registration-form .form-group:has(#reg_parking_zone) {
        grid-column: span 2;
    }
}

@media (max-width: 1024px) {
    #registration-form-content {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px 20px;
    }
    
    .registration-form .form-group {
        grid-column: span 1 !important;
    }
    
    .registration-form .form-group:has(#reg_business_name),
    .registration-form .form-group:has(#reg_representative),
    .registration-form .form-group:has(#reg_parking_zone) {
        grid-column: span 3 !important;
    }
    
    .form-section-header {
        grid-column: 1 / -1 !important;
    }
    
    .registration-header-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .registration-progress {
        text-align: center;
    }
}

@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .user-type-card {
        padding: 20px 15px;
    }
    
    #registration-form-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .registration-form .form-group {
        grid-column: span 1 !important;
    }
    
    .registration-header {
        padding: 15px 20px;
        min-height: 100px;
    }
    
    .registration-form-container {
        padding: 20px;
    }
    
    .registration-title-section {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .registration-icon {
        width: 40px;
        height: 40px;
        font-size: var(--font-lg);
    }
    
    .registration-title-text h2 {
        font-size: var(--font-lg);
    }
    
    .progress-bar {
        width: 100px;
    }
    
    .registration-form-actions {
        flex-direction: column;
    }
    
    .btn-secondary,
    .btn-primary {
        width: 100%;
    }
}

/* POKUD SCROLLOVÁNÍ NEFUNGUJE - ZKUSTE PŘIDAT TOTO CSS PRAVIDLO */

body.modal-open {
    overflow: hidden;
}

.registration-layout.show {
    overflow: hidden;
}

.registration-layout.show .registration-content {
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
}

/* ============================================
   CSS STYLY PRO ZOBRAZENÍ CHYB VE FORMULÁŘI
   ============================================ */

/* Základní styly pro chybné pole */
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 0.2rem rgba(231, 76, 60, 0.25) !important;
    background-color: #fdf2f2;
}

.form-group.has-error label {
    color: #e74c3c;
    font-weight: 600;
}

/* Styly pro chybové zprávy */
.field-error {
    color: #e74c3c;
    font-size: var(--font-sm);
    margin-top: 8px;
    padding: 8px 12px;
    background-color: #fadbd8;
    border-left: 4px solid #e74c3c;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideDown 0.3s ease-out;
}

.field-error i {
    flex-shrink: 0;
}

/* Animace pro zobrazení chyby */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 100px;
    }
}

/* Styly pro úspěšné pole */
.form-group.has-success input,
.form-group.has-success select,
.form-group.has-success textarea {
    border-color: #27ae60 !important;
    box-shadow: 0 0 0 0.2rem rgba(39, 174, 96, 0.25) !important;
    background-color: #f8fff8;
}

.form-group.has-success label {
    color: #27ae60;
}

/* Styly pro varování */
.form-group.has-warning input,
.form-group.has-warning select,
.form-group.has-warning textarea {
    border-color: #f39c12 !important;
    box-shadow: 0 0 0 0.2rem rgba(243, 156, 18, 0.25) !important;
    background-color: #fffdf2;
}

.form-group.has-warning label {
    color: #f39c12;
}

/* Fokus na chybné pole */
.form-group.has-error input:focus,
.form-group.has-error select:focus,
.form-group.has-error textarea:focus {
    border-color: #c0392b !important;
    box-shadow: 0 0 0 0.2rem rgba(192, 57, 43, 0.4) !important;
}

/* Přechody pro smooth změny */
.form-control {
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.form-group label {
    transition: color 0.3s ease;
}

/* IČO validace styly */
.form-group input[name="ico"] {
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    text-align: center;
}

/* Responsive úpravy */
@media (max-width: 768px) {
    .field-error {
        font-size: var(--font-xs);
        padding: 6px 10px;
    }
}
