/**
 * Digits Terms & Conditions Addon - Styles
 * Version: 1.0.0
 */

/* Terms wrapper container */
.digits-terms-wrapper {
    margin: 15px 0;
    padding: 0;
}

/* Terms field container */
.digits-terms-field {
    display: block;
    margin: 0;
    padding: 12px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.digits-terms-field:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
}

/* Label styling */
.digits-terms-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

/* Checkbox styling */
.digits-terms-checkbox {
    flex-shrink: 0;
    margin: 3px 0 0 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #2271b1;
}

.digits-terms-checkbox:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Terms text */
.digits-terms-text {
    flex: 1;
    user-select: none;
}

/* Link styling */
.digits-terms-text a {
    color: #2271b1;
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s ease;
}

.digits-terms-text a:hover {
    color: #135e96;
    text-decoration: none;
}

.digits-terms-text a:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Error message styling */
.digits-terms-error {
    margin-top: 8px;
    padding: 8px 12px;
    background-color: #fef2f2;
    border-left: 3px solid #dc2626;
    border-radius: 3px;
    color: #dc2626;
    font-size: 13px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        margin-top: 0;
    }
    to {
        opacity: 1;
        max-height: 100px;
        padding-top: 8px;
        padding-bottom: 8px;
        margin-top: 8px;
    }
}

/* Error state for field */
.digits-terms-field.has-error {
    border-color: #dc2626;
    background: #fff5f5;
}

/* Responsive design */
@media (max-width: 768px) {
    .digits-terms-label {
        font-size: 13px;
    }
    
    .digits-terms-field {
        padding: 10px;
    }
    
    .digits-terms-checkbox {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 480px) {
    .digits-terms-wrapper {
        margin: 12px 0;
    }
    
    .digits-terms-label {
        font-size: 12px;
        gap: 8px;
    }
    
    .digits-terms-field {
        padding: 8px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .digits-terms-field {
        background: #1e1e1e;
        border-color: #404040;
        color: #e0e0e0;
    }
    
    .digits-terms-field:hover {
        background: #252525;
        border-color: #505050;
    }
    
    .digits-terms-label {
        color: #e0e0e0;
    }
    
    .digits-terms-text a {
        color: #60a5fa;
    }
    
    .digits-terms-text a:hover {
        color: #93c5fd;
    }
    
    .digits-terms-error {
        background-color: #2d1818;
        border-left-color: #ef4444;
        color: #fca5a5;
    }
    
    .digits-terms-field.has-error {
        background: #2d1818;
        border-color: #ef4444;
    }
}

/* Accessibility improvements */
.digits-terms-checkbox:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.digits-terms-label:has(.digits-terms-checkbox:disabled) {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Print styles */
@media print {
    .digits-terms-wrapper {
        border: 1px solid #000;
        page-break-inside: avoid;
    }
}
