/**
 * Botcrawl Newsletter - Frontend Styles
 * Matches Botcrawl theme and other plugins
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
    --bcn-bg: #ffffff;
    --bcn-bg-alt: #f5f7f9;
    --bcn-text: #1a1a1a;
    --bcn-text-muted: #666666;
    --bcn-accent: #14e21c;
    --bcn-accent-dark: #10b816;
    --bcn-border: #e0e4e8;
    --bcn-radius: 8px;
    --bcn-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ==========================================================================
   Form Wrapper
   ========================================================================== */
.bcn-form-wrapper {
    font-family: var(--bcn-font);
}

.bcn-form__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--bcn-text);
    margin: 0 0 0.5rem 0;
}

.bcn-form__description {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--bcn-text-muted);
    margin: 0 0 1rem 0;
}

/* ==========================================================================
   Form
   ========================================================================== */
.bcn-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bcn-form__field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.bcn-form__label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--bcn-text);
}

.bcn-form__required {
    color: var(--bcn-accent);
}

.bcn-form__optional {
    font-weight: 400;
    color: var(--bcn-text-muted);
    font-size: 0.8125rem;
}

.bcn-form__input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--bcn-text);
    background: var(--bcn-bg);
    border: 1px solid var(--bcn-border);
    border-radius: var(--bcn-radius);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.bcn-form__input:focus {
    outline: none;
    border-color: var(--bcn-accent);
    box-shadow: 0 0 0 3px rgba(20, 226, 28, 0.1);
}

.bcn-form__input::placeholder {
    color: #999999;
}

.bcn-form__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1;
    color: #000000;
    background: var(--bcn-accent);
    border: none;
    border-radius: var(--bcn-radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.bcn-form__submit:hover {
    background: var(--bcn-accent-dark);
    transform: translateY(-1px);
}

.bcn-form__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================================================
   Messages
   ========================================================================== */
.bcn-form__message {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: var(--bcn-radius);
}

.bcn-form__message[hidden] {
    display: none;
}

.bcn-form__message--success {
    background: rgba(20, 226, 28, 0.1);
    color: #0a7d0f;
    border: 1px solid rgba(20, 226, 28, 0.3);
}

.bcn-form__message--error {
    background: rgba(220, 53, 69, 0.1);
    color: #a71d2a;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

/* ==========================================================================
   Widget Collapsible
   ========================================================================== */
.bcn-widget-collapsible {
    font-family: var(--bcn-font);
}

.bcn-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.bcn-widget-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--bcn-text);
    margin: 0;
}

.bcn-widget-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--bcn-text-muted);
    transition: all 0.2s ease;
}

.bcn-widget-toggle:hover {
    background: var(--bcn-bg-alt);
    color: var(--bcn-text);
}

.bcn-widget-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.2s ease;
}

.bcn-widget-toggle[aria-expanded="false"] svg {
    transform: rotate(-90deg);
}

.bcn-widget-content {
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.bcn-widget-content[hidden] {
    display: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 480px) {
    .bcn-form__input {
        padding: 0.625rem 0.875rem;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .bcn-form__submit {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
    }
}
