/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    min-height: 100vh;
    padding: 1rem;
}

/* Container */
.container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Card */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 2rem;
}

@media (max-width: 640px) {
    .card {
        padding: 1.5rem;
    }
}

/* Typography */
h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1.5rem;
    text-align: center;
}

@media (max-width: 640px) {
    h1 {
        font-size: 1.5rem;
    }
}

/* Form elements */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.required {
    color: #dc2626;
    margin-left: 0.25rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Button */
button[type="submit"] {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    margin-top: 1rem;
}

button[type="submit"]:hover:not(:disabled) {
    background: #059669;
}

button[type="submit"]:active:not(:disabled) {
    transform: scale(0.98);
}

button[type="submit"]:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

button[type="submit"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
}

/* Loading state */
.loader {
    text-align: center;
    padding: 3rem 1rem;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #10b981;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loader p {
    color: #6b7280;
    font-size: 1rem;
}

/* Messages */
.message {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    text-align: center;
}

.message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.message.success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Success state */
.success-state {
    text-align: center;
    padding: 2rem 1rem;
}

.success-state h2 {
    font-size: 1.5rem;
    color: #10b981;
    margin-bottom: 1rem;
}

.success-state p {
    font-size: 1.125rem;
    color: #374151;
    line-height: 1.7;
}

/* Error state */
.error-state {
    text-align: center;
    padding: 2rem 1rem;
}

.error-state h2 {
    font-size: 1.5rem;
    color: #dc2626;
    margin-bottom: 1rem;
}

.error-state p {
    font-size: 1rem;
    color: #6b7280;
}

/* Hidden */
.hidden {
    display: none;
}

/* Accessibility */
input:invalid:not(:placeholder-shown) {
    border-color: #f87171;
}

input:invalid:not(:placeholder-shown):focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}
