/* Beautiful Forms Design System for Dirty Paws */
/* Modern, clean, and pet-friendly aesthetic */

:root {
    --form-primary: #4a90e2;
    --form-primary-hover: #357abd;
    --form-secondary: #8B4513;
    --form-accent: #ff6b6b;
    --form-success: #51cf66;
    --form-error: #ff6b6b;
    --form-warning: #feca57;
    --form-bg: #ffffff;
    --form-bg-secondary: #f8f9fa;
    --form-border: #e1e4e8;
    --form-border-focus: #4a90e2;
    --form-text: #2c3e50;
    --form-text-muted: #6c757d;
    --form-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
    --form-shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.1);
    --form-radius: 12px;
    --form-radius-small: 8px;
}

/* Form Container Styles */
.contact-form,
.newsletter-form,
.checkout-form,
.quiz-form,
form {
    position: relative;
    background: var(--form-bg);
    padding: 2rem;
    border-radius: var(--form-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.contact-form:hover,
form:hover {
    box-shadow: var(--form-shadow-hover);
}

/* Form Groups */
.form-group {
    margin-bottom: 1.75rem;
    position: relative;
}

/* Labels - Modern Floating Style */
.form-group label {
    display: block;
    font-weight: 600;
    color: var(--form-text);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

/* Input Fields - Beautiful Modern Design */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea,
.input-field {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid var(--form-border);
    border-radius: var(--form-radius-small);
    background-color: var(--form-bg-secondary);
    color: var(--form-text);
    transition: all 0.3s ease;
    outline: none;
}

/* Placeholder Styling */
input::placeholder,
textarea::placeholder {
    color: var(--form-text-muted);
    font-style: italic;
}

/* Focus States - Beautiful Glow Effect */
input:focus,
select:focus,
textarea:focus,
.input-field:focus {
    border-color: var(--form-border-focus);
    background-color: var(--form-bg);
    box-shadow: var(--form-shadow);
    transform: translateY(-2px);
}

/* Select Dropdown Styling */
select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234a90e2' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 3rem;
}

/* Textarea Styling */
textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

/* Checkbox and Radio Button Styling */
input[type="checkbox"],
input[type="radio"] {
    width: auto;
    margin-right: 0.75rem;
    transform: scale(1.2);
    accent-color: var(--form-primary);
    cursor: pointer;
}

.checkbox-group,
.radio-group {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.checkbox-group label,
.radio-group label {
    margin-bottom: 0;
    cursor: pointer;
    user-select: none;
    font-weight: 400;
}

/* Button Styling - Primary and Secondary */
.btn,
button[type="submit"] {
    display: inline-block;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--form-radius-small);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
}

.btn-primary,
button[type="submit"] {
    background: linear-gradient(135deg, var(--form-primary) 0%, var(--form-primary-hover) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.btn-primary:hover,
button[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.4);
}

.btn-primary:active,
button[type="submit"]:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

/* Button Ripple Effect */
.btn::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

/* Secondary Button */
.btn-secondary {
    background: linear-gradient(135deg, var(--form-secondary) 0%, #6d3410 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.4);
}

/* Outline Button */
.btn-outline {
    background: transparent;
    color: var(--form-primary);
    border: 2px solid var(--form-primary);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--form-primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.3);
}

/* Form Validation States */
.form-group.success input,
.form-group.success select,
.form-group.success textarea {
    border-color: var(--form-success);
}

.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: var(--form-error);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Error and Success Messages */
.form-message {
    padding: 0.75rem 1rem;
    border-radius: var(--form-radius-small);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

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

.form-message.success {
    background: rgba(81, 207, 102, 0.1);
    color: var(--form-success);
    border: 1px solid rgba(81, 207, 102, 0.3);
}

.form-message.error {
    background: rgba(255, 107, 107, 0.1);
    color: var(--form-error);
    border: 1px solid rgba(255, 107, 107, 0.3);
}

/* Newsletter Form Specific Styles */
.newsletter-form {
    display: flex;
    gap: 1rem;
    max-width: 500px;
    margin: 2rem auto;
    padding: 0.5rem;
    background: var(--form-bg-secondary);
    border-radius: var(--form-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.newsletter-form input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 1rem;
}

.newsletter-form input:focus {
    box-shadow: none;
    transform: none;
}

.newsletter-form button {
    padding: 1rem 2rem;
    border-radius: var(--form-radius-small);
    white-space: nowrap;
}

/* Contact Form Grid */
.contact-form-container {
    background: white;
    padding: 3rem;
    border-radius: var(--form-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.contact-form-container h2 {
    color: var(--form-text);
    margin-bottom: 1rem;
}

.contact-form-container p {
    color: var(--form-text-muted);
    margin-bottom: 2rem;
}

/* Two Column Form Layout */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Quiz Form Styles */
.quiz-container {
    background: var(--form-bg-secondary);
    padding: 2rem;
    border-radius: var(--form-radius);
    text-align: center;
}

.quiz-option {
    display: block;
    width: 100%;
    padding: 1.25rem;
    margin-bottom: 1rem;
    background: white;
    border: 2px solid var(--form-border);
    border-radius: var(--form-radius-small);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 1rem;
}

.quiz-option:hover {
    border-color: var(--form-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.2);
}

.quiz-option.selected {
    background: var(--form-primary);
    color: white;
    border-color: var(--form-primary);
}

/* Progress Bar for Multi-Step Forms */
.form-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.form-progress::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--form-border);
    transform: translateY(-50%);
    z-index: 0;
}

.form-progress-step {
    position: relative;
    z-index: 1;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--form-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--form-text-muted);
    transition: all 0.3s ease;
}

.form-progress-step.active {
    background: var(--form-primary);
    color: white;
    border-color: var(--form-primary);
    transform: scale(1.1);
}

.form-progress-step.completed {
    background: var(--form-success);
    color: white;
    border-color: var(--form-success);
}

/* Loading States */
.form-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.form-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 3px solid var(--form-border);
    border-top-color: var(--form-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .contact-form,
    form {
        padding: 1.5rem;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter-form button {
        width: 100%;
    }
    
    .btn {
        width: 100%;
        padding: 1rem 1.5rem;
    }
}

/* Accessibility */
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
    outline: 3px solid var(--form-primary);
    outline-offset: 2px;
}

/* Disabled States */
input:disabled,
select:disabled,
textarea:disabled,
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: var(--form-bg-secondary);
}

/* Icon Integration */
.form-group.has-icon {
    position: relative;
}

.form-group.has-icon .form-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--form-text-muted);
    pointer-events: none;
}

.form-group.has-icon input,
.form-group.has-icon select {
    padding-left: 3rem;
}

/* Floating Action Buttons */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: flex-end;
}

.form-actions.center {
    justify-content: center;
}

/* Tooltip for Form Help */
.form-tooltip {
    display: inline-block;
    margin-left: 0.5rem;
    width: 20px;
    height: 20px;
    background: var(--form-primary);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    font-size: 0.75rem;
    cursor: help;
    position: relative;
}

.form-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--form-radius-small);
    white-space: nowrap;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    z-index: 10;
}

/* Special Paw Print Animation */
.paw-print-bg {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 60px;
    height: 60px;
    opacity: 0.05;
    transform: rotate(-15deg);
    pointer-events: none;
}

/* Success Animation */
@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.form-success-animation {
    animation: successPulse 0.5s ease;
}