/**
 * Vanilla Auth - CSS Styles
 */

/* Container */
.vanilla-auth-container {
    max-width: 480px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.vanilla-auth-form-wrapper,
.vanilla-auth-profile-wrapper {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.vanilla-auth-form-wrapper h2,
.vanilla-auth-profile-wrapper h2 {
    margin: 0 0 1.5rem;
    font-size: 1.75rem;
    text-align: center;
    color: #1a1a1a;
}

.vanilla-auth-profile-wrapper h3 {
    margin: 2rem 0 1rem;
    font-size: 1.25rem;
    color: #1a1a1a;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.vanilla-auth-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Messages */
.vanilla-auth-message {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.vanilla-auth-error {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.vanilla-auth-success {
    background-color: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* Form Fields */
.vanilla-auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.vanilla-auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.vanilla-auth-field label {
    font-weight: 500;
    font-size: 0.9rem;
    color: #374151;
}

.vanilla-auth-field input[type="text"],
.vanilla-auth-field input[type="email"],
.vanilla-auth-field input[type="password"] {
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.vanilla-auth-field input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.vanilla-auth-hint {
    font-size: 0.8rem;
    color: #6b7280;
}

/* Checkbox */
.vanilla-auth-checkbox {
    flex-direction: row;
    align-items: center;
}

.vanilla-auth-checkbox label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 400;
}

.vanilla-auth-checkbox input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

/* Button */
.vanilla-auth-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background-color: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
}

.vanilla-auth-button:hover {
    background-color: #2563eb;
    color: #fff;
}

.vanilla-auth-button-secondary {
    background-color: #6b7280;
}

.vanilla-auth-button-secondary:hover {
    background-color: #4b5563;
}

/* Links */
.vanilla-auth-links {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.vanilla-auth-links a {
    color: #3b82f6;
    text-decoration: none;
}

.vanilla-auth-links a:hover {
    text-decoration: underline;
}

.vanilla-auth-separator {
    margin: 0 0.5rem;
    color: #d1d5db;
}

/* Profile Header */
.vanilla-auth-profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #eee;
}

.vanilla-auth-avatar img {
    border-radius: 50%;
    width: 96px;
    height: 96px;
}

.vanilla-auth-user-info h2 {
    margin: 0 0 0.25rem;
    text-align: left;
}

.vanilla-auth-username {
    color: #6b7280;
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
}

.vanilla-auth-member-since {
    color: #9ca3af;
    margin: 0;
    font-size: 0.8rem;
}

/* Field Row (two columns) */
.vanilla-auth-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 480px) {
    .vanilla-auth-field-row {
        grid-template-columns: 1fr;
    }

    .vanilla-auth-profile-header {
        flex-direction: column;
        text-align: center;
    }

    .vanilla-auth-user-info h2 {
        text-align: center;
    }
}

/* Logout */
.vanilla-auth-logout {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
    text-align: center;
}

/* Loading state */
.vanilla-auth-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.vanilla-auth-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: vanilla-auth-spin 0.8s linear infinite;
}

@keyframes vanilla-auth-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Profile Photo Upload */
.vanilla-auth-photo-upload {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px dashed #d1d5db;
}

.vanilla-auth-photo-preview {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.vanilla-auth-photo-preview img,
.vanilla-auth-profile-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.vanilla-auth-photo-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 0.85rem;
}

.vanilla-auth-photo-icon {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.vanilla-auth-photo-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.vanilla-auth-file-input {
    display: none;
}

.vanilla-auth-button-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.vanilla-auth-remove-photo {
    font-size: 0.85rem;
    color: #dc2626;
}

.vanilla-auth-remove-photo input[type="checkbox"] {
    accent-color: #dc2626;
}

/* Textarea */
.vanilla-auth-field textarea {
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.vanilla-auth-field textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Profile container - wider for more fields */
.vanilla-auth-profile-container {
    max-width: 600px;
}

@media (max-width: 600px) {
    .vanilla-auth-photo-upload {
        flex-direction: column;
        text-align: center;
    }

    .vanilla-auth-photo-actions {
        align-items: center;
    }
}