/**
 * Fresh PDF Download Frontend Styles
 */

/* Main container */
.fresh-pdf-container {
    max-width: 600px;
    margin: 30px auto;
    padding: 30px;
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header section */
.fresh-pdf-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 25px;
}

.fresh-pdf-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    padding: 12px;
    margin-right: 16px;
    flex-shrink: 0;
}

.fresh-pdf-icon svg {
    color: white;
    display: block;
}

.fresh-pdf-info {
    flex: 1;
}

.fresh-pdf-title {
    font-size: 22px;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.fresh-pdf-description {
    font-size: 15px;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

/* Meta information */
.fresh-pdf-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 14px;
}

.fresh-pdf-meta-item {
    display: flex;
    align-items: center;
    color: #64748b;
}

.fresh-pdf-meta-item .icon {
    margin-right: 6px;
    color: #667eea;
}

.fresh-pdf-meta-item strong {
    color: #2d3748;
    margin-left: 4px;
}

/* Form styles */
.fresh-pdf-form {
    margin-top: 0;
}

.fresh-pdf-form-group {
    margin-bottom: 20px;
}

.fresh-pdf-form-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    font-size: 14px;
}

.fresh-pdf-form-group .required {
    color: #dc2626;
}

.fresh-pdf-form-group input[type="text"],
.fresh-pdf-form-group input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s ease;
    background-color: #ffffff;
    box-sizing: border-box;
}

.fresh-pdf-form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.fresh-pdf-form-group input::placeholder {
    color: #9ca3af;
}

/* Two-column layout for names */
.fresh-pdf-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* CAPTCHA styles */
.fresh-pdf-captcha-group {
    display: flex;
    justify-content: center;
    margin: 25px 0;
}

.fresh-pdf-captcha-group .g-recaptcha {
    margin: 0 auto;
}

/* Button styles */
.fresh-pdf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    min-height: 52px;
    position: relative;
}

.fresh-pdf-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.fresh-pdf-btn:active {
    transform: translateY(0);
}

.fresh-pdf-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.fresh-pdf-btn .btn-icon {
    margin-right: 8px;
    display: flex;
    align-items: center;
}

.fresh-pdf-btn .btn-loading {
    display: flex;
    align-items: center;
}

.fresh-pdf-btn .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Direct download button */
.fresh-pdf-btn-direct {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.fresh-pdf-btn-direct:hover {
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

/* Message styles */
.fresh-pdf-message {
    margin-top: 20px;
    padding: 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.fresh-pdf-message.success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
}

.fresh-pdf-message.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.fresh-pdf-message.info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
}

.fresh-pdf-message p {
    margin: 0;
}

/* Direct download section */
.fresh-pdf-direct {
    text-align: center;
    margin-top: 20px;
}

/* Consent checkbox styling */
.fresh-pdf-consent-group {
    margin: 20px 0;
}

.fresh-pdf-consent-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
    color: #4a5568;
}

.fresh-pdf-consent-label input[type="checkbox"] {
    margin-right: 12px;
    margin-top: 2px;
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e0;
    border-radius: 4px;
    background: #ffffff;
    cursor: pointer;
    flex-shrink: 0;
}

.fresh-pdf-consent-label input[type="checkbox"]:checked {
    background: #667eea;
    border-color: #667eea;
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='m13.854 3.646-7.5 7.5a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6 10.293l7.146-7.147a.5.5 0 0 1 .708.708z'/%3e%3c/svg%3e");
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
}

.fresh-pdf-consent-label input[type="checkbox"]:focus {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.consent-text {
    flex: 1;
}

.consent-text a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.consent-text a:hover {
    text-decoration: underline;
}

/* Legal links styling */
.fresh-pdf-legal-links {
    margin: 15px 0 20px 0;
    text-align: center;
    border-top: 1px solid #e2e8f0;
    padding-top: 15px;
}

.fresh-pdf-legal-links a {
    display: inline-block;
    margin: 0 12px;
    font-size: 12px;
    color: #718096;
    text-decoration: none;
    transition: color 0.2s ease;
}

.fresh-pdf-legal-links a:hover {
    color: #667eea;
    text-decoration: underline;
}

.fresh-pdf-legal-links .privacy-link::before {
    content: "🔒 ";
    margin-right: 4px;
}

.fresh-pdf-legal-links .unsubscribe-link::before {
    content: "✉️ ";
    margin-right: 4px;
}

/* Responsive design */
@media (max-width: 768px) {
    .fresh-pdf-container {
        margin: 20px auto;
        padding: 20px;
    }
    
    .fresh-pdf-header {
        flex-direction: column;
        text-align: center;
    }
    
    .fresh-pdf-icon {
        margin: 0 auto 16px auto;
    }
    
    .fresh-pdf-form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .fresh-pdf-meta {
        flex-direction: column;
        gap: 12px;
    }
    
    .fresh-pdf-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .fresh-pdf-container {
        margin: 15px;
        padding: 16px;
    }
    
    .fresh-pdf-btn {
        padding: 12px 20px;
        font-size: 15px;
    }
    
    .fresh-pdf-title {
        font-size: 18px;
    }
    
    .fresh-pdf-consent-label {
        font-size: 13px;
    }
    
    .fresh-pdf-legal-links a {
        display: block;
        margin: 5px 0;
        font-size: 11px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .fresh-pdf-container {
        border: 2px solid #000000;
    }
    
    .fresh-pdf-btn {
        background: #000000;
        border: 2px solid #000000;
    }
    
    .fresh-pdf-form-group input {
        border: 2px solid #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .fresh-pdf-btn,
    .fresh-pdf-form-group input,
    .fresh-pdf-message {
        transition: none;
    }
    
    .fresh-pdf-btn:hover {
        transform: none;
    }
    
    .spinner {
        animation: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .fresh-pdf-container {
        background: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .fresh-pdf-title {
        color: #f9fafb;
    }
    
    .fresh-pdf-description {
        color: #d1d5db;
    }
    
    .fresh-pdf-meta {
        background: #111827;
    }
    
    .fresh-pdf-meta-item {
        color: #d1d5db;
    }
    
    .fresh-pdf-form-group label {
        color: #f3f4f6;
    }
    
    .fresh-pdf-form-group input {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .fresh-pdf-form-group input:focus {
        border-color: #667eea;
        background: #4b5563;
    }
    
    .fresh-pdf-form-group input::placeholder {
        color: #9ca3af;
    }
    
    .fresh-pdf-consent-label {
        color: #e2e8f0;
    }
    
    .fresh-pdf-consent-label input[type="checkbox"] {
        border-color: #4a5568;
        background: #2d3748;
    }
    
    .fresh-pdf-consent-label input[type="checkbox"]:checked {
        background: #667eea;
        border-color: #667eea;
    }
    
    .fresh-pdf-legal-links {
        border-color: #4a5568;
    }
    
    .fresh-pdf-legal-links a {
        color: #a0aec0;
    }
    
    .fresh-pdf-legal-links a:hover {
        color: #90cdf4;
    }
}
