/**
 * Renewal Flow Styles
 * Bootstrap 4 based styling for renewal process
 */

.renewal-area {
    max-width: 1200px;
    margin: 0 auto;
}

.renewal-area .page-title {
    font-size: 2rem;
    font-weight: 600;
    color: #2c3e50;
}

/* Standardize Typography */
.renewal-area h1, .renewal-area h2, .renewal-area h3, .renewal-area h4, .renewal-area h5, .renewal-area h6, .renewal-area .text-dark {
    color: #2c3e50 !important;
}

.renewal-area p, .renewal-area .text-muted {
    color: #6c757d !important;
    line-height: 1.5;
}

/* Loader Step */
#step-loader .spinner-border {
    border-width: 0.3rem;
}

/* 2FA Step */
#step-2fa form {
    max-width: 100%;
}

#step-2fa #identifier {
    font-size: 1.1rem;
    padding: 0.75rem;
    border-radius: 6px;
    text-align: center;
    letter-spacing: 0.5px;
}

#step-2fa .btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
}

/* Process Card */
.renewal-process-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 0 20px rgba(0,0,0,0.6) !important;
    border: 1px solid rgba(0,0,0,0.6);
    overflow: hidden;
}

/* Separator */
.renewal-separator {
    border-top: 1px solid rgba(0,0,0,0.08);
}

.renewal-steps {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: relative;
}

.renewal-step-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.renewal-step-item .step-icon-wrapper {
    position: relative;
    flex-shrink: 0;
}

.renewal-step-item .step-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #f0fcfc;
    color: #19b2ad;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: 2px solid rgba(25, 178, 173, 0.3); /* Greenish border */
    transition: all 0.3s ease;
}

.renewal-step-item .step-number {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: #19b2ad;
    border: 2px solid #fff;
    color: #fff;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.renewal-step-item .step-content {
    padding-top: 0.5rem;
}

.renewal-step-item .step-content h6 {
    font-size: 1.1rem;
}

.renewal-step-item .step-content p {
    font-size: 1rem;
}

/* Connector Line Mobile */
.renewal-steps::before {
    content: '';
    position: absolute;
    top: 30px;
    bottom: 65px; /* Stop before the last item */
    left: 30px; /* half of icon width */
    width: 2px;
    background: rgba(25, 178, 173, 0.3); /* Greenish line */
    z-index: 0;
}


/* Typography Standardization */
.renewal-area .text-muted,
.renewal-step-item .step-content p {
    color: #6c757d !important;
    font-size: 0.9rem;
    line-height: 1.5;
}

.renewal-area h1,
.renewal-area h2,
.renewal-area h3,
.renewal-area h4,
.renewal-area h5,
.renewal-area h6,
.renewal-step-item .step-content h6 {
    color: #333 !important;
    font-weight: 600;
    line-height: 1.2;
}

/* Custom Separator */
.renewal-separator {
    border: 0;
    border-top: 1px solid rgba(25, 178, 173, 0.15);
    margin: 3rem 0;
    width: 100%;
}

/* Form Step */
#step-form .alert-info {
    border-left: 4px solid #17a2b8;
}

/* Payment Step */
#step-payment {
    min-height: 300px;
}

/* Error messages */
.renewal-area .alert-danger {
    border-left: 4px solid #dc3545;
}

.renewal-area .alert-warning {
    border-left: 4px solid #ffc107;
}

/* Responsive */
@media (max-width: 768px) {
    .renewal-area .page-title {
        font-size: 1.5rem;
    }
    
    #step-2fa .btn-lg {
        width: 100%;
    }
    
    .renewal-process-card .card-body {
        padding: 1.5rem;
    }
    
    .renewal-step-item .step-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .renewal-steps::before {
        left: 24px;
    }
}

/* Loading button animation */
.btn .spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Form validation */
.was-validated .form-control:invalid {
    border-color: #dc3545;
}

.was-validated .form-control:valid {
    border-color: #28a745;
}

.radio-button-group {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    justify-content: flex-start;
}

.radio-button-option {
    position: relative;
    flex: 0 0 auto;
    min-width: 120px;
}

.radio-button-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-button-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 20px;
    background: #f8f9fa;
    border: 1px solid #ccc;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    user-select: none;
    min-height: 40px;
    position: relative;
    border-radius: 6px;
    max-width: 400px;

}

.radio-button-label:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
}

.radio-button-label::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-radius: 50%;
    background: #fff;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.radio-button-option input[type="radio"]:checked + .radio-button-label {
    background: #19b2ad;
    border-color: #19b2ad;
    color: #fff;
    font-weight: 600;
}

.radio-button-option input[type="radio"]:checked + .radio-button-label::before {
    border-color: #fff;
    background: #fff;
    box-shadow: inset 0 0 0 4px #19b2ad;
}

.radio-button-label:hover::before {
    border-color: #adb5bd;
}

.radio-button-option input[type="radio"]:focus + .radio-button-label {
    box-shadow: 0 0 0 2px rgba(25, 178, 173, 0.25);
    outline: none;
}


/* Checkbox Button Styles */
.checkbox-button-option {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-button-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-button-label {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px 20px;
    background: #f8f9fa;
    border: 1px solid #ccc;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    user-select: none;
    min-height: 40px;
    position: relative;
    border-radius: 6px;
    max-width: 350px;
}

.checkbox-button-label:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
}

.checkbox-button-label::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-radius: 3px;
    background: #fff;
    transition: all 0.25s ease;
    flex-shrink: 0;
    position: relative;
}

.checkbox-button-label::after {
    content: '';
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    border-radius: 1px;
    transform: translate(-50%, -50%) rotate(45deg);
    opacity: 0;
    transition: all 0.25s ease;
}

.checkbox-button-option input[type="checkbox"]:checked + .checkbox-button-label {
    background: #19b2ad;
    border-color: #19b2ad;
    color: #fff;
    font-weight: 600;
}

.checkbox-button-option input[type="checkbox"]:checked + .checkbox-button-label::before {
    border-color: #fff;
    background: #19b2ad;
}

.checkbox-button-option input[type="checkbox"]:checked + .checkbox-button-label::after {
    opacity: 1;
}

.checkbox-button-label:hover::before {
    border-color: #adb5bd;
}

.checkbox-button-option input[type="checkbox"]:focus + .checkbox-button-label {
    box-shadow: 0 0 0 2px rgba(25, 178, 173, 0.25);
    outline: none;
}

/* Desktop optimizations */
@media (min-width: 769px) {
    .radio-button-option {
        min-width: 100px;
    }
    
    .radio-button-label {
        padding: 8px 16px;
    }
    
    .checkbox-button-label {
        padding: 8px 16px;
    }
    
    .checkbox-button-label::after {
        left: 24px;
    }

    #medycyna-sanitarne-register-user fieldset.summary-step .payment-section table td:first-of-type {
        width: 300px;
    }

    /* Steps Desktop */
    .renewal-steps {
        flex-direction: row;
        justify-content: space-between;
        gap: 0;
    }

    /* Horizontal connector line */
    .renewal-steps::before {
        top: 40px;
        left: 16%; /* Start after first icon */
        right: 16%; /* End before last icon */
        width: auto;
        height: 2px;
        bottom: auto;
    }

    .renewal-step-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
        flex: 1;
        gap: 1rem;
    }

    .renewal-step-item .step-content {
        padding-top: 0;
        padding: 0 1rem;
    }

    .renewal-step-item .step-icon {
        width: 80px;
        height: 80px;
        font-size: 2rem;
        background: #fff; /* Background to cover line */
        position: relative;
        z-index: 1;
    }

    /* To ensure line is behind icons, icons need background */
    
    .renewal-step-item .step-number {
        top: 0;
        right: 0;
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .radio-button-group {
        gap: 8px;
    }
    
    .radio-button-option {
        flex: 1;
        min-width: 0;
    }
    
    .radio-button-label {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
    }
    
    .radio-button-label::before {
        width: 18px;
        height: 18px;
    }
}

#renewal-form-container #renewal-form .form-group {
    margin-bottom: 1.5rem;
}