/* Forms and Input Styling - Cohesive with PetalCart Design */

/* Form Container Styles */
.form-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 0 20px;
}

.form-card {
    padding: 40px;
    margin: 20px 0;
    border-radius: 20px;
}

.form-card h1,
.form-card h2 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    font-size: 28px;
    font-weight: 600;
    position: relative;
    padding-bottom: 15px;
}

.form-card h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #d88195, #c76b83);
    border-radius: 2px;
}

/* Form Groups */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Form Controls */
.form-control {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    color: #333;
    font-size: 16px;
    font-family: 'Segoe UI', sans-serif;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-control::placeholder {
    color: #999;
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: #d88195;
    box-shadow: 0 0 0 4px rgba(216, 129, 149, 0.1);
    transform: translateY(-2px);
}

.form-control:valid {
    border-color: #4CAF50;
}

.form-control:invalid:not(:placeholder-shown) {
    border-color: #f44336;
}

/* Form Select */
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 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Textarea Styles */
textarea.form-control {
    resize: vertical;
    min-height: 100px;
    font-family: 'Segoe UI', sans-serif;
}

/* Form Row - Two columns */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 10px;
}

/* Error Messages */
.form-error {
    color: #f44336;
    font-size: 12px;
    margin-top: 6px;
    display: block;
}

.errorlist {
    list-style: none;
    padding: 0;
    margin: 0;
}

.errorlist li {
    color: #f44336;
    font-size: 12px;
    margin-bottom: 5px;
}

/* Form Help Text */
.help-text {
    color: #666;
    font-size: 13px;
    margin-top: 5px;
    display: block;
}

/* Input with icon container */
.input-group {
    position: relative;
    display: flex;
}

.input-group .form-control {
    flex: 1;
}

.input-group-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
}

/* Checkbox and Radio */
.form-check {
    margin: 20px 0;
    padding: 15px;
    background: rgba(216, 129, 149, 0.05);
    border-radius: 10px;
    border-left: 4px solid #d88195;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #d88195;
}

.form-check label {
    display: inline;
    margin-bottom: 0;
    cursor: pointer;
    font-weight: 500;
    color: #333;
}

/* Password Input Toggle */
.password-toggle {
    position: relative;
}

.password-toggle .form-control {
    padding-right: 40px;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    transition: color 0.2s;
}

.password-toggle-btn:hover {
    color: #d88195;
}

/* Form Buttons */
.form-buttons {
    display: flex;
    gap: 15px;
    margin-top: 35px;
    flex-wrap: wrap;
}

.btn-frame {
    flex: 1;
    min-width: 150px;
}

/* Primary Button */
.btn-primary {
    padding: 14px 28px;
    background: linear-gradient(135deg, #d88195, #c76b83);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(216, 129, 149, 0.3);
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #c76b83, #b0556f);
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(216, 129, 149, 0.4);
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(216, 129, 149, 0.3);
}

.btn-primary:disabled {
    background: #ccc;
    color: #999;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Secondary Button */
.btn-secondary {
    padding: 14px 28px;
    background: rgba(216, 129, 149, 0.1);
    border: 2px solid #d88195;
    border-radius: 10px;
    color: #d88195;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-secondary:hover {
    background: #d88195;
    color: white;
    transform: translateY(-3px);
}

/* Form Success State */
.form-success {
    background: rgba(76, 175, 80, 0.1);
    border: 2px solid #4CAF50;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    color: #2e7d32;
}

.form-success svg {
    margin-right: 10px;
}

/* Messages - alerts */
.messages {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.alert {
    padding: 16px 20px;
    margin-bottom: 15px;
    border-radius: 12px;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    border-color: #4CAF50;
    color: #2e7d32;
}

.alert-error,
.alert-danger {
    background: rgba(244, 67, 54, 0.1);
    border-color: #f44336;
    color: #c62828;
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    border-color: #FFC107;
    color: #f57f17;
}

.alert-info {
    background: rgba(33, 150, 243, 0.1);
    border-color: #2196F3;
    color: #1565c0;
}

/* Form Divider */
.form-divider {
    margin: 30px 0;
    text-align: center;
    position: relative;
}

.form-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e0e0e0;
}

.form-divider span {
    background: white;
    padding: 0 15px;
    color: #999;
    font-size: 14px;
    position: relative;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .form-card {
        padding: 25px;
    }

    .form-card h1,
    .form-card h2 {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .form-buttons {
        gap: 10px;
    }

    .btn-frame {
        min-width: 100%;
    }

    .form-control {
        padding: 12px 14px;
        font-size: 16px;
    }
}

/* Loading State */
.form-loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Validation Icons */
.has-success .form-control {
    border-color: #4CAF50;
}

.has-error .form-control {
    border-color: #f44336;
}

/* Focus visible for accessibility */
.form-control:focus-visible {
    outline: 2px solid #d88195;
    outline-offset: 2px;
}

/* Field Groups with Labels */
.field-group {
    margin-bottom: 25px;
}

.field-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

.field-group .form-control {
    width: 100%;
}

.field-group .help-text {
    color: #999;
    font-size: 13px;
    margin-top: 6px;
}
