/**
 * Form Styles
 * Contains form controls, labels, and validation styles
 */

/* Enhanced Form Styling */
.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control, .form-select {
    display: block;
    width: 100%;
    padding: 0.85rem 1rem;
    min-height: 44px;
    font-size: 1rem; /* 16px minimum to prevent iOS zoom on focus */
    font-family: var(--body-font);
    line-height: 1.5;
    color: var(--dark-color);
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: var(--border-radius);
    transition: var(--transition);
    box-sizing: border-box;
}

.form-control:focus, .form-select:focus {
    border-color: var(--burgundy);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(var(--burgundy-rgb, 247, 139, 120), 0.25);
}

.form-control::placeholder {
    color: #b0b0b8;
    opacity: 1;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%232c2c54' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 12px;
}

/* For form elements with helper text */
.text-muted {
    color: var(--gray-color);
    font-size: 0.85rem;
    margin-top: 6px;
    display: block;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 30px;
    margin-bottom: 50px;
}

.form-actions .btn {
    padding: 14px 32px;
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.form-actions .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    z-index: -1;
    transition: width 0.3s ease;
}

.form-actions .btn:hover::before {
    width: 100%;
}

.form-actions .btn-primary {
    background-color: var(--primary-color);
    border: none;
    box-shadow: 0 4px 15px rgba(var(--burgundy-rgb, 247, 139, 120), 0.35);
}

.form-actions .btn-primary:hover {
    background-color: var(--primary-color);
    box-shadow: 0 6px 20px rgba(var(--burgundy-rgb, 247, 139, 120), 0.5);
    transform: translateY(-2px);
}

/* Form field with icons */
.input-with-icon {
    position: relative;
}

.input-with-icon .form-control {
    padding-left: 45px;
    padding-right: 10px;
    width: 100%;
    box-sizing: border-box;
}

.input-with-icon .icon {
    position: absolute;
    left: 16px;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-color);
    transition: var(--transition);
    height: auto;
    width: 20px;
}

.input-with-icon .form-control:focus + .icon {
    color: var(--primary-color);
}

/* Floating label form group */
.form-floating {
    position: relative;
}

.form-floating label {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    padding: 1rem;
    pointer-events: none;
    border: 1px solid transparent;
    transform-origin: 0 0;
    transition: opacity .1s ease-in-out,transform .1s ease-in-out;
    color: var(--gray-color);
    font-family: var(--body-font);
}

.form-floating .form-control:focus ~ label,
.form-floating .form-control:not(:placeholder-shown) ~ label {
    opacity: .65;
    transform: scale(.85) translateY(-0.5rem) translateX(0.15rem);
    background-color: white;
    padding: 0 0.5rem;
    color: var(--burgundy);
}

.form-floating .form-control {
    padding-top: 1.625rem;
    padding-bottom: 0.625rem;
}

/* Form Check Styles */
.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.form-check-input {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    flex-shrink: 0;
}

.form-check-label {
    cursor: pointer;
    user-select: none;
    color: var(--dark-color);
}

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

/* Progress bar styling */
.progress {
    height: 10px;
    background-color: #e9ecef;
    border-radius: 30px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(to right, var(--burgundy), var(--burgundy-hover));
    transition: width 0.3s ease;
    border-radius: 30px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-right: 5px;
    font-size: 10px;
    color: white;
    font-weight: bold;
}

/* Alert styling */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
    border-left: 4px solid transparent;
}

.alert-info {
    background-color: var(--burgundy-soft);
    border-left-color: var(--burgundy);
    color: var(--burgundy);
}

.alert-danger {
    background-color: var(--pale-red);
    border-left-color: var(--primary-red);
    color: var(--primary-red);
}

/* Flash message container (.flash-messages) margin-top is in style.css to account for nav + stripe; single source avoids cascade override. */
.flash-message {
    background-color: var(--pale-green);
    color: var(--primary-green);
    padding: 10px 16px;
    margin-bottom: 8px;
    width: fit-content;
    max-width: 100%;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-green);
    font-weight: 600;
    animation: slideIn 0.3s ease;
    font-family: var(--body-font);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
