/* Modern Design System for Pacific Coast Law Testimonial Form */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #0b3c5d; /* Deep Pacific Ocean Blue */
    --primary-hover: #082d47;
    --accent-color: #328cc1; /* Bright Sea Blue */
    --accent-hover: #1d70b8;
    --bg-color: #f7f9fc; /* Sand & Sea Mist Soft Off-White */
    --card-bg: #ffffff;
    --text-primary: #1d2530; /* Charcoal Slate */
    --text-secondary: #5a6b82; /* Muted Blue-Gray */
    --border-color: #e2e8f0; /* Light Slate Border */
    --border-hover: #cbd5e1;
    --border-focus: #328cc1;
    --success-color: #10b981; /* Emerald green */
    --error-color: #ef4444; /* Rose red */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 25px -5px rgba(11, 60, 93, 0.08), 0 8px 10px -6px rgba(11, 60, 93, 0.05);
    --shadow-lg: 0 20px 40px -15px rgba(11, 60, 93, 0.12);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
    padding: 2rem 1rem;
}

/* Background Decorative Gradients */
body::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(50, 140, 193, 0.15) 0%, rgba(247, 249, 252, 0) 70%);
    z-index: -1;
    border-radius: 50%;
    pointer-events: none;
}

body::after {
    content: '';
    position: absolute;
    bottom: -10%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(11, 60, 93, 0.08) 0%, rgba(247, 249, 252, 0) 70%);
    z-index: -1;
    border-radius: 50%;
    pointer-events: none;
}

/* Page Wrapper / Container */
.container {
    width: 100%;
    max-width: 620px;
    margin: 0 auto;
    z-index: 2;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Card Wrapper with Glassmorphism touch */
.form-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
}

/* Subtle accent header line */
.form-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-color) 100%);
}

/* Header Styles */
.form-header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

/* Logo placement mockup placeholder */
.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.logo-mock {
    height: 48px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

.form-title {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--primary-color);
    line-height: 1.3;
    margin-bottom: 0.5rem;
    transition: opacity var(--transition-fast);
}

.form-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 400;
    transition: opacity var(--transition-fast);
}

/* Language Switcher Button (Pill Slide) */
.lang-toggle-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.lang-switch {
    background: #e9eff5;
    padding: 4px;
    border-radius: 50px;
    display: inline-flex;
    position: relative;
    cursor: pointer;
    user-select: none;
    box-shadow: inset 0 2px 4px rgba(11, 60, 93, 0.05);
}

.lang-btn {
    padding: 6px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: 50px;
    transition: color var(--transition-normal);
    z-index: 1;
    position: relative;
}

.lang-btn.active {
    color: #ffffff;
}

.lang-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 54px; /* Default size for EN button */
    height: calc(100% - 8px);
    background: var(--primary-color);
    border-radius: 50px;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), width 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 2px 8px rgba(11, 60, 93, 0.2);
}

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

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    transition: color var(--transition-fast);
}

.form-label span.required {
    color: var(--error-color);
    margin-left: 2px;
}

/* Input Fields styling */
.form-control {
    width: 100%;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-primary);
    background-color: #fbfcfd;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.form-control:hover {
    border-color: var(--border-hover);
    background-color: #ffffff;
}

.form-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px rgba(50, 140, 193, 0.15);
    background-color: #ffffff;
}

textarea.form-control {
    resize: vertical;
    min-height: 250px;
    line-height: 1.5;
}

/* Input validations styling */
.form-group.has-error .form-control {
    border-color: var(--error-color);
}

.form-group.has-error .form-control:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}

.error-message {
    color: var(--error-color);
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 0.35rem;
    display: none;
    animation: fadeIn 0.3s ease;
}

.form-group.has-error .error-message {
    display: block;
}

/* Character count display */
.char-counter {
    position: absolute;
    bottom: -1.2rem;
    right: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Submit Button & Actions */
.form-actions {
    margin-top: 2rem;
}

.btn-submit {
    width: 100%;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    border: none;
    border-radius: var(--radius-sm);
    padding: 14px 24px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(11, 60, 93, 0.2);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(11, 60, 93, 0.28);
}

.btn-submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(11, 60, 93, 0.15);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading Spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
    display: none;
}

.btn-submit.loading .spinner {
    display: block;
}

.btn-submit.loading span.btn-text {
    opacity: 0.8;
}

/* Toast Message/Modal styles for success state */
.success-card {
    text-align: center;
    padding: 1rem 0;
    display: none;
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.success-icon-container {
    width: 72px;
    height: 72px;
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
}

.success-icon {
    font-size: 2.2rem;
    font-weight: bold;
}

.success-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.success-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.75rem;
}

.btn-reset {
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent-color);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-reset:hover {
    background-color: #e9eff5;
    border-color: var(--accent-color);
    color: var(--primary-color);
}

/* Footer Copyright */
.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.form-footer a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.form-footer a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Language switching animation helper */
.lang-fade-out {
    opacity: 0;
}

/* Animations */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

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

/* Responsive adjustments */
@media (max-width: 480px) {
    body {
        padding: 1rem 0.5rem;
    }
    .form-card {
        padding: 1.5rem;
        border-radius: var(--radius-md);
    }
    .form-title {
        font-size: 1.4rem;
    }
}

/* Star Rating selector styles */
.star-rating-container {
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 4px;
}

.star-rating-container input {
    display: none;
}

.star-rating-container label {
    font-size: 2rem;
    color: #cbd5e1;
    cursor: pointer;
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.star-rating-container label:hover,
.star-rating-container label:hover ~ label,
.star-rating-container input:checked ~ label {
    color: #f59e0b; /* Golden stars */
}

.star-rating-container label:hover {
    transform: scale(1.15);
}

/* Textarea Toolbar Styles */
.textarea-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-top-left-radius: var(--radius-sm);
    border-top-right-radius: var(--radius-sm);
    padding: 6px 12px;
}

.textarea-toolbar + textarea.form-control {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.toolbar-btn {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.toolbar-btn:hover {
    background: #e2e8f0;
    border-color: var(--accent-color);
    color: var(--primary-color);
}

.toolbar-separator {
    width: 1px;
    height: 18px;
    background: var(--border-color);
    margin: 0 4px;
}

.toolbar-color-label {
    position: relative;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: #ffffff;
    cursor: pointer;
    overflow: hidden;
    transition: all var(--transition-fast);
}

.toolbar-color-label:hover {
    border-color: var(--accent-color);
}

.toolbar-color-picker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.color-indicator {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Rich Text Editor Styles */
.rich-editor {
    white-space: pre-wrap;
    word-wrap: break-word;
    background-color: #fbfcfd;
    min-height: 250px;
    max-height: 500px;
    overflow-y: auto;
}

.rich-editor:empty::before {
    content: attr(placeholder);
    color: var(--text-secondary);
    opacity: 0.7;
    cursor: text;
}

.rich-editor:focus {
    background-color: #ffffff;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px rgba(50, 140, 193, 0.15);
}
