/* GG Forms - Public Styles */
.gg-form-wrapper {
    max-width: 680px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.gg-form-wrapper.layout-full { max-width: 100%; }
.gg-form-wrapper.layout-narrow { max-width: 480px; }

.gg-form-title {
    font-size: 1.5em;
    margin-bottom: 0.25em;
    color: #1a1a1a;
}

.gg-form-description {
    color: #666;
    margin-bottom: 1.5em;
}

/* Form Row & Fields */
.gg-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.gg-form-field {
    flex: 1 1 100%;
    position: relative;
}

.gg-form-field.width-50 { flex: 1 1 calc(50% - 8px); }
.gg-form-field.width-33 { flex: 1 1 calc(33.33% - 11px); }
.gg-form-field.width-25 { flex: 1 1 calc(25% - 12px); }

.gg-form-field label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: #333;
    font-size: 0.9em;
}

.gg-form-field .required-mark {
    color: #e53e3e;
    margin-left: 2px;
}

.gg-form-field input[type="text"],
.gg-form-field input[type="email"],
.gg-form-field input[type="tel"],
.gg-form-field input[type="url"],
.gg-form-field input[type="number"],
.gg-form-field input[type="date"],
.gg-form-field input[type="time"],
.gg-form-field textarea,
.gg-form-field select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95em;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.gg-form-field input:focus,
.gg-form-field textarea:focus,
.gg-form-field select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.gg-form-field textarea { resize: vertical; min-height: 100px; }

.gg-form-field .field-description {
    font-size: 0.8em;
    color: #888;
    margin-top: 4px;
}

/* Checkbox & Radio */
.gg-form-field .checkbox-group,
.gg-form-field .radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gg-form-field .checkbox-group label,
.gg-form-field .radio-group label {
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* Consent */
.gg-form-field.field-consent label {
    font-weight: normal;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.gg-form-field.field-consent input[type="checkbox"] {
    margin-top: 3px;
}

.gg-form-field.field-consent a {
    color: #4f46e5;
    text-decoration: underline;
}

/* Rating */
.gg-form-rating {
    display: flex;
    gap: 4px;
}

.gg-form-rating .star {
    font-size: 1.5em;
    cursor: pointer;
    color: #d1d5db;
    transition: color 0.15s;
}

.gg-form-rating .star.active,
.gg-form-rating .star:hover {
    color: #f59e0b;
}

/* Slider */
.gg-form-slider {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gg-form-slider input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    background: #e5e7eb;
    border-radius: 3px;
    outline: none;
}

.gg-form-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4f46e5;
    cursor: pointer;
}

.gg-form-slider .slider-value {
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

/* File Upload */
.gg-form-file-drop {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.gg-form-file-drop:hover,
.gg-form-file-drop.dragover {
    border-color: #4f46e5;
    background: #f5f3ff;
}

.gg-form-file-drop .drop-icon { font-size: 2em; color: #9ca3af; }
.gg-form-file-drop .drop-text { margin-top: 8px; color: #666; }

/* Multi-Step */
.gg-form-progress {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    padding: 0;
}

.gg-form-progress-step {
    display: flex;
    align-items: center;
    flex: 1;
}

.gg-form-progress-step .step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85em;
    flex-shrink: 0;
}

.gg-form-progress-step.active .step-number {
    background: #4f46e5;
    color: #fff;
}

.gg-form-progress-step.completed .step-number {
    background: #10b981;
    color: #fff;
}

.gg-form-progress-step .step-line {
    flex: 1;
    height: 2px;
    background: #e5e7eb;
    margin: 0 8px;
}

.gg-form-progress-step.completed .step-line { background: #10b981; }

.gg-form-page { display: none; }
.gg-form-page.active { display: block; }

.gg-form-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

/* Buttons */
.gg-form-submit,
.gg-form-next,
.gg-form-prev {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.gg-form-submit,
.gg-form-next {
    background: #4f46e5;
    color: #fff;
}

.gg-form-submit:hover,
.gg-form-next:hover {
    background: #4338ca;
    transform: translateY(-1px);
}

.gg-form-prev {
    background: #f3f4f6;
    color: #374151;
}

.gg-form-prev:hover { background: #e5e7eb; }

.gg-form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Validation */
.gg-form-field.has-error input,
.gg-form-field.has-error textarea,
.gg-form-field.has-error select {
    border-color: #e53e3e;
}

.gg-form-field .field-error {
    color: #e53e3e;
    font-size: 0.8em;
    margin-top: 4px;
    display: none;
}

.gg-form-field.has-error .field-error { display: block; }

/* Success Message */
.gg-form-success {
    text-align: center;
    padding: 40px 20px;
}

.gg-form-success .success-icon {
    font-size: 3em;
    color: #10b981;
    margin-bottom: 12px;
}

.gg-form-success h3 {
    font-size: 1.3em;
    margin-bottom: 8px;
}

/* Dynamic Response */
.gg-form-response {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 20px;
    margin-top: 16px;
}

/* Countdown Timer */
.gg-form-countdown {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.gg-form-countdown .countdown-unit {
    text-align: center;
}

.gg-form-countdown .countdown-number {
    font-size: 2em;
    font-weight: 700;
    color: #1a1a1a;
}

.gg-form-countdown .countdown-label {
    font-size: 0.75em;
    color: #666;
    text-transform: uppercase;
}

/* Payment */
.gg-form-payment-element {
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    min-height: 44px;
}

/* Calculation */
.gg-form-calculation {
    font-size: 1.2em;
    font-weight: 600;
    color: #4f46e5;
    padding: 12px 16px;
    background: #f5f3ff;
    border-radius: 6px;
}

/* Signature */
.gg-form-signature canvas {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: crosshair;
    width: 100%;
    height: 150px;
}

.gg-form-signature .clear-signature {
    font-size: 0.8em;
    color: #4f46e5;
    cursor: pointer;
    margin-top: 4px;
}

/* Inline Layout */
.gg-form-wrapper.layout-inline .gg-form-row {
    flex-wrap: nowrap;
    align-items: flex-end;
}

.gg-form-wrapper.layout-inline .gg-form-submit {
    flex-shrink: 0;
}

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

.gg-form-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: gg-spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

/* Responsive */
@media (max-width: 600px) {
    .gg-form-field.width-50,
    .gg-form-field.width-33,
    .gg-form-field.width-25 {
        flex: 1 1 100%;
    }

    .gg-form-wrapper.layout-inline .gg-form-row {
        flex-wrap: wrap;
    }
}
